2012-01-26 182 views
2

最近我移植到了Ubuntu,並且在我安裝apache2之前,我在Ubuntu上配置和編譯PHP 5.2.17的一切都很順利。在安裝php 5.2.17問題之後在ubuntu 11.10上安裝apache2

現在,當我嘗試安裝的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. 

爲解決此問題的任何想法?

回答

1
  • 嘗試從/ 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得到消息;)或

    service apache2 status

  • 檢查apache的狀態現在重新編譯PHP 5.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

  • 然後讓&進行安裝。這應該做的工作

1

如果您在編譯Apache之前編譯了PHP,那可能是您的問題所在。你可以從PHP和Apache發佈你的config.nice文件嗎?這可以更好地瞭解你的問題在哪裏。

-EDIT-通常,在使用Apache編譯PHP時,必須使用--with-apache標誌或--with-apxs,它是Apache的一部分。這可能是一個好看的地方。

+0

是的,這是肯定的安裝PHP之前就在apache之前@fkniya暗示。 –