0

Alright so I will outline how everything is setup and running for me on my dedicated box. I have everything working accept eAccelerator only works on one of my PHP applications.

Apache2

I have Apache2 setup and running with virtualhosts. Apache has a file at /etc/apache2/php-version-5.2.conf which gets included on each vhost when it needs to run PHP 5.2:

#include for sites that still need to run at php 5.2.x

SetEnv PHP_INI_SCAN_DIR /opt/php5.2/conf.d/
ScriptAlias /php5-cgi /usr/lib/cgi-bin/php5-cgi
Action application/x-httpd-php5 /php5-cgi

<FilesMatch "\.php">
SetHandler application/x-httpd-php5
</FilesMatch>

AddHandler application/x-httpd-php5 .php .php5 .php4 .php3 .phtml

PHP

I have installed the latest version of PHP 5.3 from the Debian repo. I also have a compiled version of PHP 5.2.17 sitting at /opt/php5.2/. To compile PHP 5.2 and get fastcgi delivering to the appropriate PHP application I followed these instructions. This works as needed.

eAccelerator

eAccelerator is working on PHP 5.3 from the Debian repo but I cannot get it to load on the compiled version of PHP 5.2.

I compiled from source for both PHP installs from these instructions.

In /etc/php5/apache2/conf.d/eaccelerator.ini I have:

extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

In /opt/php5.2/conf.d/eaccelerator.ini I have:

;extension="/opt/php5.2/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
;zend_extension="/opt/php5.2/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
;zend_extension_ts="/opt/php5.2/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
;extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator-php-5.2"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

phpinfo();

The output of phpinfo(); on each site is as expected with the exception of eAccelerator not being enabled on the PHP 5.2 sites. It is however enabled perfectly on the PHP 5.3 sites.

Virtualhost config

Anytime I need a site to load PHP 5.2 I simply load the aforementioned php-version-5.2.conf file, otherwise the site defaults to PHP 5.3.

nicholas.alipaz
  • 155
  • 2
  • 7
  • What [configure options](http://php.net/manual/en/configure.about.php) did you use when you compiled PHP from source? E.g. `--enable-fastcgi`. – tacotuesday Aug 08 '12 at 00:49
  • I used `'./configure' '--prefix=/opt/php5.2' '--with-config-file-path=/opt/php5.2' '--with-mysqli' '--with-mysql' '--with-curl' '--with-gd' '--with-jpeg-dir' '--enable-cli' '--enable-fastcgi' '--enable-discard-path' '--enable-force-cgi-redirect' '--enable-mbstring' '--with-zlib' `, thanks for the response. – nicholas.alipaz Aug 08 '12 at 04:36

1 Answers1

1

Did you remember to uncomment the extension load? As shown, the extension is not loaded in /opt/php5.2/conf.d/eaccelerator.ini

troseman
  • 311
  • 1
  • 7