Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to load Zend Optimizer into my self-compiled php.

Here is how i compile my php:

wget http://museum.php.net/php5/php-5.2.6.tar.gz
tar xvfz php-5.2.6.tar.gz
cd php-5.2.6
./configure --prefix=/usr/local/php --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/apache2/conf.d
make install

However, the zend_extension directive in php.ini is getting completely ignored. If I use a non-existent path i still don't even get a error message. When using a pre-compiled php library everything is working fine.

In php.ini I also set

error_reporting = E_ALL & ~E_NOTICE
display_startup_errors = On
log_errors = On
error_log = /var/log/php_errors.log

error_log = /var/log/php_errors.log is only getting written when a error in a php-file occurs.

In apache.conf i set

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel debug

I also tried compiling with --disable-maintainer-zts --disable-safe-mode which was mentioned on another website. I choose php-5.2.6 because it is the version of the (working) pre-compiled php, but i also tried php-version 5.2.16.

share|improve this question
    
Just out of interest, when you run php -i from the command line, have you checked that it's loading the php.ini file you thought you were loading? –  Kev Jul 27 '12 at 1:52
    
For example: Configuration File (php.ini) Path => /etc Loaded Configuration File => /etc/php.ini Scan this dir for additional .ini files => /etc/php.d Additional .ini files parsed => /etc/php.d/apc.ini etc –  Kev Jul 27 '12 at 1:55
    
Also look for something that looks like : Zend Extension => 220090626 Zend Extension Build => API220090626,NTS on that first page or two of results. Posting the output of php -i into your question would be useful. –  Kev Jul 27 '12 at 1:56

1 Answer 1

up vote 0 down vote accepted

The Solution:

According to the Zend Optimizer user guide

The Zend Optimizer will not run if the following PHP settings are enabled:

  • Debug Mode - Check that your PHP was compiled in non-debug mode - This can be checked by looking at the top part of the phpinfo() function output and checking "Debug Build" row (ZEND_DEBUG in older PHP versions) - it should say "no".
  • Thread Safety - Check that your PHP was compiled in ZTS mode for Windows and non-ZTS mode for UNIX. This can be checked by looking at the top part of the phpinfo() function and checking "Thread Safety" row - it should say "disabled" for Unix and "enabled" for Windows.
  • Enable Versioning - Check that your PHP was compiled without the Enable Versioning setting. This can be checked by looking at the top part of the phpinfo() function and checking to see if a row called "--enable-versioning" exists in the Configure Command section - if it does exists the PHP should be compiled without this option.

The configure options --disable-zts and --disable-maintainer-zts (which should turn of Thread Safety mode) do NOT exist in PHP 5.2.x

You can control the Thread-Safety mode by doing the following:

I found it, it was because installing apache2-dev package on my system (Ubuntu) automatically installs apache2-thread-dev whose apxs2 tells the PHP build system to build with thread-safety on. Therefore, the solution was to directly install apache2-prefork-dev package. (Credits for this go to amr-mostafa)

The behavior described above does also apply to debian. So removing apache-tread-dev and installing apache2-prefork-dev did the deal!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.