我试图让PHP在Solaris 10计算机上运行,使用以下配置成功安装了PHP而没有出现任何错误:
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --with-pdo-mysql --with-mssql=/usr/local/freetds --without-pgsql --with-zlib --with-zlib-dir=/usr/local --with-iconv-dir=/usr/local --with-pcre-dir=/usr/local --with-gettext=/usr/local --with-libxml-dir=/usr/local --with-gd --with-xpm-dir=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gnu-ld --enable-shared --enable-mbstring --enable-exif --enable-soap --enable-zip --enable-ftp --enable-mysqlnd --disable-zend-signals --disable-static
然而,当我启动我的Apache服务器并访问php信息页面时:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
我得到一个空白页面..
运行php -m时,我收到很多关于许多失败库的致命错误,下面是输出:
[root@mm]#php -m
ld.so.1: php: fatal: libreadline.so.6: open failed: No such file or directory
ld.so.1: php: fatal: libmysqlclient.so.18: open failed: No such file or directory
ld.so.1: php: fatal: libsybdb.so.5: open failed: No such file or directory
ld.so.1: php: fatal: libmcrypt.so.4: open failed: No such file or directory
ld.so.1: php: fatal: libltdl.so.7: open failed: No such file or directory
ld.so.1: php: fatal: /usr/sfw/lib/amd64//libfreetype.so.6: wrong ELF class: ELFCLASS64
ld.so.1: php: fatal: libX11.so.6: open failed: No such file or directory
ld.so.1: php: fatal: libxcb.so.1: open failed: No such file or directory
ld.so.1: php: fatal: libXau.so.6: open failed: No such file or directory
ld.so.1: php: fatal: libXdmcp.so.6: open failed: No such file or directory
ld.so.1: php: fatal: libpng14.so.14: open failed: No such file or directory
ld.so.1: php: fatal: libjpeg.so.8: open failed: No such file or directory
ld.so.1: php: fatal: libdb-4.8.so: open failed: No such file or directory
ld.so.1: php: fatal: libgdbm.so.3: open failed: No such file or directory
ld.so.1: php: fatal: libpcre.so.1: open failed: No such file or directory
ld.so.1: php: fatal: libcrypto.so.0.9.8: open failed: No such file or directory
ld.so.1: php: fatal: libssl.so.0.9.8: open failed: No such file or directory
ld.so.1: php: fatal: libgssapi_krb5.so.2: open failed: No such file or directory
ld.so.1: php: fatal: libkrb5.so.3: open failed: No such file or directory
ld.so.1: php: fatal: libk5crypto.so.3: open failed: No such file or directory
ld.so.1: php: fatal: libcom_err.so.3: open failed: No such file or directory
ld.so.1: php: fatal: libcurl.so.4: open failed: No such file or directory
ld.so.1: php: fatal: libldap-2.4.so.2: open failed: No such file or directory
ld.so.1: php: fatal: liblber-2.4.so.2: open failed: No such file or directory
ld.so.1: php: fatal: libintl.so.8: open failed: No such file or directory
ld.so.1: php: fatal: libsasl2.so.2: open failed: No such file or directory
ld.so.1: php: fatal: libssh2.so.1: open failed: No such file or directory
ld.so.1: php: fatal: libiodbc.so.2: open failed: No such file or directory
ld.so.1: php: fatal: libiconv.so.2: open failed: No such file or directory
ld.so.1: php: fatal: relocation error: file /usr/local/bin/php: symbol rl_library_version: referenced symbol not found
Killed
Thnaks
答案 0 :(得分:0)
在您的配置文件中有这个指令:
extension_dir =
它应指向您的扩展所在的位置,它所抱怨的扩展位置。它似乎没有指向它会找到你的php库的任何地方,因此它失败了。
此外,您应该检查错误日志中是否有任何错误,我建议您在配置中打开display_startup_errors
指令,以查看php模块与apache一起启动时的关键问题。
答案 1 :(得分:0)
感谢您提供的有用信息,我设法通过添加以下内容来解决问题:
LoadModule php7_module modules/libphp7.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "/usr/local/php/etc/" //this is the location of the PHP configurations file
到Apache配置文件,然后重新启动Apache服务器..