最近我移民到Ubuntu,在安装apache2之前,在Ubuntu上配置和编译PHP 5.2.17一切都很顺利。
现在,当我尝试安装apache2时,它安装成功,但不幸的是,在启动apache2时我收到了这个错误:
[crit] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Pre-configuration failed
Action 'configtest' failed.
有什么解决这个问题的想法吗?
-
尝试从/etc/和/var/folders中删除所有apache2文件夹。然后删除apache及其依赖项
sudo apt-get --purge remove apache2 apache2-mpm-prefork apache2-utils apache2.2-common
-
然后再次尝试安装apache:
sudo apt-get install apache2
检查127.0.0.1以获得"It works!"消息;)或通过检查apache状态
service apache2 status
-
现在使用以下配置选项重新编译php5.2.17并启用快速cgi(根据需要编辑,这是我的):
./configure --prefix=/usr/local/php-5.1.6 --with-config-file-path=/etc/php-5.1.6 --disable-ipv6 --with-zlib --enable-bcmath --with-bz2 --with-curl --enable-exif --enable-ftp --with-gd --with-ttf --enable-gd-native-ttf --with-imap-ssl --enable-mbstring --with-mhash --with-mysql --with-mysqli --enable-pcntl --with-pdo-mysql --with-pdo-sqlite --enable-shmop --enable-soap --enable-sockets --enable-sqlite-utf8 --with-xmlrpc --with-xsl --with-pear --enable-fastcgi
-
然后制作&让安装它。这应该做的工作
如果你在编译Apache之前编译了PHP,那可能就是你的问题所在。你能从PHP和Apache发布你的config.nice文件吗?这可能会让你更好地了解你的问题在哪里
-EDIT-通常,当使用Apache编译PHP时,必须使用--withapache标志,或者--withapxs,它是Apache的一部分。那可能是个好地方。
安装Apache2+PHP所需的一切:http://www.php.net/manual/en/install.unix.apache2.php
核心选项:http://php.net/manual/en/configure.about.php
最后,为什么不使用deb
软件包呢?