logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS Twitter


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.


Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Running two PHP-versions, both with OPcache
Author
Jan-E



Joined: 09 Mar 2012
Posts: 1186
Location: Amsterdam, NL, EU

PostPosted: Tue 09 Jul '13 20:29    Post subject: Running two PHP-versions, both with OPcache Reply with quote

The fairly new OP cache extension is working so fast at my systems that I wanted to run both PHP 5.3 (for Drupal 6) and PHP 5.5 (for Drupal 7) with their own php_opcache.dll. Big disappointment: it seemed a no go because at least one of the PHP's suffered from internal server errors.

I opened an issue for this at github, aimed at the developers of OPcache (formerly ZendOptimizerPlus). Gradually I came to the conclusion that the reason for the 500-errors was that PHP 5.3 and PHP 5.5 were using the same memory area for their precompiled caches.

A bit by trial-and-error I managed to use a separate memory area for x86 and x64 versions. My Drupal 6 sites are now running X86 PHP 5.3 with php_opcache.dll and my Drupal 7 sites are using X64 PHP 5.5 with php_opcache64.dll, built from slightly altered sources. The only real difference is that php_opcache64 uses a different semaphore file than php_opcache. That was enough, seemingly.

At the moment I am uploading new x64 builds of PHP 5.5.0, 5.4.17 and 5.3.26 with both flavours of php_opcache. The download locations did not change:

https://dl.dropboxusercontent.com/u/8954372/php-5.5.0-nts-Win32-VC11-x64.zip
https://dl.dropboxusercontent.com/u/8954372/php-5.5.0-Win32-VC11-x64.zip
https://dl.dropboxusercontent.com/u/8954372/php-5.4.17-nts-Win32-VC9-x64.zip
https://dl.dropboxusercontent.com/u/8954372/php-5.4.17-Win32-VC9-x64.zip
https://dl.dropboxusercontent.com/u/8954372/php-5.3.26-nts-Win32-VC9-x64.zip
https://dl.dropboxusercontent.com/u/8954372/php-5.3.26-Win32-VC9-x64.zip

I would love to hear feedback from anyone that has the guts to experiment with these mixed PHP-versions. For PHP 5.5 you do not have to use my full builds. If you have X64 PHP 5.5 running you might just add the php_opcache64.dll from my builds to the extension dir of PHP 5.5 and change the line in your php.ini to zend_extension=php_opcache64.dll. If this runs fine you are ready to add another X86 PHP-version with OPcache to your Apache config. For instance the official PHP 5.3 from http://windows.php.net/download/ and the (more or less) official opcache.dll's from http://windows.php.net/downloads/pecl/releases/opcache/7.0.2/

The other way around is even simpler. If you have already running any X86 PHP with OPcache, you are ready to add any X64 PHP version with php_opcache64.dll.

Disclaimer: highly experimental. Do not do this on your production server. Even I did not do that yet.

Background info:
https://github.com/zendtech/ZendOptimizerPlus/issues/109

Please report back your experiences.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2970
Location: Hilversum, NL, EU

PostPosted: Tue 09 Jul '13 21:08    Post subject: Reply with quote

Opcache is creating in his temp dir a file for example:

ZendOPcache.MemoryBase@SYSTEM with the contents: 000000E584FC0000

Who knows, maybe different temp file in the ini solves it.

Steffen

ps. See also my observation at www.apachelounge.com/viewtopic.php?p=25112
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1186
Location: Amsterdam, NL, EU

PostPosted: Tue 09 Jul '13 22:01    Post subject: Reply with quote

And php_opcache64.dll is creating ZendOPcache64.MemoryBase@SYSTEM

Only on my system it was in C:\Windows. Perhaps specifying a temp dir for OPcache would have been enough..

Can you run multiple PHP's without any troubles, if you specify different temp dir's?

With respect to the other observations about flutuations: phpinfo() gives you some stats about the OPcache usage. Maybe the cache is purged at some times.

000000E584FC0000: this must have been an X64 PHP. Does the mmap_base (which it is) ever change?

And do you see the same fluctuations with a X86 PHP?


Last edited by Jan-E on Tue 09 Jul '13 22:51; edited 1 time in total
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2970
Location: Hilversum, NL, EU

PostPosted: Tue 09 Jul '13 22:32    Post subject: Reply with quote

X64 creates here ZendOPcache.MemoryBase@SYSTEM, using x64 NTS php from php.net. See nowhere a php_opcache64.dll in that download.

The address in ZendOPcache.MemoryBase@SYSTEM changes when restarting Apache.

Fluctuations:

Fluctations also in X86 and the cache is not purged/restarted. It worries me.


Steffen
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1186
Location: Amsterdam, NL, EU

PostPosted: Tue 09 Jul '13 22:46    Post subject: Reply with quote

The php_opcache64.dll in in my downloads. See topicstart.

Edit: both php_opcache.dll and php-opcache64.dll in my builds are the latest from github. They might be different from the PHP.net downloads.

Edit2: how did you specify a temp dir voor opcache? There is no mention of it in the readme:
https://github.com/zendtech/ZendOptimizerPlus/blob/f80a5538063f470d7c42b386a357d47794108a74/README
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2970
Location: Hilversum, NL, EU

PostPosted: Tue 09 Jul '13 23:12    Post subject: Reply with quote

Sorry I overlooked it in the start post.

I meant in mod_fcgid:

FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"

Change the other PHP to an other folder.


Still the same fluctuations with your VC11 build. The script page generation time is just a copy of the forum here with the google stuff removed.


Steffen
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1186
Location: Amsterdam, NL, EU

PostPosted: Wed 10 Jul '13 15:55    Post subject: Reply with quote

Steffen wrote:
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"

Change the other PHP to an other folder.

Good idea, but I could not get it to work. I changed the temp for my X64 PHP 5.5 to C:\phpdev\php55pgo.x64\tmp\. And I added a X64 PHP 5.4 as PHP-CGI, so with the system temp.

If I first load PHP 5.4 after a reboot, it runs with these specs:
http://x32.elijst.nl/phpinfo.php54nts64.htm
However, as soon as I access my Drupal 7 sites (with the PHP 5.5) the 5.4 produces an internal server error.

The PHP 5.5 got some server errors as well, so they still seem to be sharing memory.
Code:
C:\phpdev\php55pgo.x64\tmp>type c:\windows\z*

c:\windows\ZendOPcache.MemoryBase@SYSTEM
20000000

c:\windows\ZendOPcache64.MemoryBase@SYSTEM
0000000003C10000

C:\phpdev\php55pgo.x64\tmp>type z*

ZendOPcache64.MemoryBase@SYSTEM
0000000004180000

I reverted the situation to what it was: a running X86 PHP 5.3+OPcache en X64 PHP 5.5+OPcache64
Back to top


Reply to topic   Topic: Running two PHP-versions, both with OPcache View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads