Apache,PHP和MysqL.他安装了PHP,但没有配置MysqL扩展(我假设因为服务器只托管一个基于rails的网站).
所以我需要重新配置PHP以使用MysqL扩展.这是当前的PHP配置(来自PHPhinfo();):
- './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--
- target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--
- bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--
- includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--
- localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--
- infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-
- file-path=/etc' '--with-config-file-scan-dir=/etc/PHP.d' '--disable-debug' '--with-pic' '--
- disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--
- with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--
- with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-
- png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--
- with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets'
- '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-
- trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--
- with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--
- enable-dbx' '--enable-dio' '--with-mime-magic=/usr/share/file/magic.mime' '--without-
- sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--with-
- apxs2=/usr/sbin/apxs' '--without-MysqL' '--without-gd' '--without-odbc' '--disable-dom' '--
- disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-
- xmlwriter'
你可以看到他在那里有–without-MysqL.
当你配置PHP使用–with-MysqL时,你必须指定MysqL的路径吗?还是MysqL源码?或类似的东西?像这样的东西:
这个现有设置的问题是MysqL已经安装,除了我不知道它安装在哪里…我知道有/etc/init.d/MysqLd.我还找到了以下目录:
/usr/lib中/ MysqL的/
在/ usr /包括/ MysqL的/
的/ usr /共享/ MysqL的/
任何人都能指出我在正确的方向吗?我只是不知道在PHP配置中使用什么目录–with-MysqL.
UPDATE
好的,所以我重新配置并重新安装并安装了PHP.现在,当我重新启动Apache时,我得到以下内容:
- [warn] module PHP5_module is already loaded,skipping
这是因为PHP之前已经在服务器上运行了吗?我查看了httpd.conf,它只有一个PHP5_module实例加载…
但是,现在查看PHPinfo();它显示了我刚刚配置/安装的新更新版本中使用的PHP.
另外,PHPinfo();将MysqL显示为正在使用,但是当我尝试安装say,wordpress(使用MysqL)时,wordpress会出现此错误:
我现在应该在哪里看?
更新#2
目前还没有解决方案.我已经完成了PHP的配置,包括MysqL和PHPinfo(); (是的,我正在使用file.PHP查看此内容)显示–with-MysqL = shared,/ usr(根据下面的其他用户建议). PHP仍然没有将MysqL扩展识别为在配置中.
我只是不明白你应该在-with-MysqL =的末尾放置什么路径?我找到了以下目录:
- /usr/bin/ contains:
- MysqL (executable?)
- /usr/lib/MysqL/ contains:
- libdbug.a libmyisammrg.a libMysqLclient_r.so libMysqLclient.so libmystrings.a MysqLbug
- libheap.a libMysqLclient.a libMysqLclient_r.so.15 libMysqLclient.so.15 libmysys.a MysqL_config
- libmyisam.a libMysqLclient_r.a libMysqLclient_r.so.15.0.0 libMysqLclient.so.15.0.0 libvio.a
- /usr/include/MysqL/ contains:
- chardefs.h keymaps.h my_config.h my_global.h MysqL_com.h MysqL_time.h readline.h sql_common.h tilde.h
- decimal.h m_ctype.h my_config_i386.h my_list.h MysqLd_ername.h MysqL_version.h rlmbutil.h sql_state.h typelib.h
- errmsg.h m_string.h my_dbug.h my_net.h MysqLd_error.h my_sys.h rlprivate.h sslopt-case.h xmalloc.h
- history.h my_alloc.h my_dir.h my_no_pthread.h MysqL_embed.h my_xml.h rlshell.h sslopt-longopts.h
- keycache.h my_attribute.h my_getopt.h my_pthread.h MysqL.h raid.h rltypedefs.h sslopt-vars.h
- /usr/share/MysqL/ contains:
- charsets english french italian my-innodb-heavy-4G.cnf MysqL_fix_privilege_tables.sql norwegian romanian spanish
- czech errmsg.txt german japanese my-large.cnf MysqL_system_tables_data.sql norwegian-ny russian swedish
- danish estonian greek korean my-medium.cnf MysqL_system_tables.sql polish serbian ukrainian
- dutch fill_help_tables.sql hungarian my-huge.cnf my-small.cnf MysqL_test_data_timezone.sql portuguese slovak
这有什么帮助吗?
更新3
是的我正在使用虚拟主机.这是我的conf文件:
- Listen 80
- NameVirtualHost *:80
- <VirtualHost *:80>
- ServerName thedomain.com
- ServerAlias www.thedomain.com
- DocumentRoot /u1/thedomain.com/public
- RailsEnv production
- </VirtualHost>
- <VirtualHost *:80>
- ServerName subdomain.thedomain.com
- DocumentRoot /u1/subdomain.thedomain.com/public
- </VirtualHost>
我正在尝试在子域上设置基本的wordpress安装.我仍然收到此错误:
解决了
我刚刚在PHP配置中添加了–with-MysqL(没有路径)并重新安装它,PHP显然已经从MysqL自己发现了它所需要的东西.感谢大家的见解.