Author |
|
mrcullers
Joined: 16 Jun 2012 Posts: 22 Location: USA, Bradenton FL
|
Posted: Sat 30 Jun '12 1:24 Post subject: Apache 64 / php 32, php5apache2_4.dll not loading |
|
|
For those that have not been following me with my setup experiences. Short history.. Had issues setting up apache x64 with php x64 and fast-cgi x64. Solved the problem as it was the php.ini standard file cannot be applied directly to the x64 php build as it needs zlib shut off. Turn on mod_deflate instead.
Next I mentioned that PHP seamed to run a little slow and was suggested to keep the apache x64 and the fast-cgi x64 as it does not mind running with php x32.
Ok, did that! So now the problem is, it is reporting in the windows event viewer that the php5apache2_4.dll cannot load into the server as it is not a valid Win32 application. I think I am using the correct version....
Got it from...
+ php5apache2_4.dll-php-5.4-win32.zip
and using the one in the folder marked...
+ /PHP 5.4.4/php5apache2_4.dll
The PHP version I am using is the 5.4.4 zipped x32 version from php.net.
Any thoughts? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 30 Jun '12 3:03 Post subject: |
|
|
You can not load a 32bit dll into a 64bit apache. Simply does not work. The only way to run 32bit php with 64bit apache is using mod_fcgid and than you don't need php5apache2_4.dll. |
|
Back to top |
|
mrcullers
Joined: 16 Jun 2012 Posts: 22 Location: USA, Bradenton FL
|
Posted: Sat 30 Jun '12 6:08 Post subject: |
|
|
James Blond wrote: | You can not load a 32bit dll into a 64bit apache. Simply does not work. The only way to run 32bit php with 64bit apache is using mod_fcgid and than you don't need php5apache2_4.dll. |
I never even stopped and realized that is what I was doing, but now that you pointed that out.. duhh!
Ok, looks like my blind study all by lonesome self has me now asking, wha, wha, what?
Are you saying mod_fcgid replaces php5apache2_4.dll?? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 30 Jun '12 13:23 Post subject: |
|
|
Yes it does!
What php5apache2_4.dll does: it loads php as a module / dll into the apache (httpd.exe) process. So when php crashes and it is inside the apache process --> apache crashes.
What mod_fcgid does: apache starts when needed 1 to n php-cgi(.exe) external process(es). Via the cgi protocol apache tells the php-cgi.exe which php file to execute. php-cgi executes the php file and sends the result of that to the apache process. Apache devlivers that as with the php5apache2_4.dll to the client / browser. Since php-cgi runs as an external process and not inside apache it does not hurt the apache process when it crashes. Ok you see an error message in apache since apache doesn't get a correct reply from php-cgi process. But with the next request apache starts a new php-cgi process and resumes its work. Different to the old cgi mod_fcgid starts the php-cgi process only once and than reuses that process. The old cgi started a php-cgi process and killed it after each request. That's why you may see some idle php-cgi processes in your task manager.
Here is an example set up. Maybe you have to adjust some path variables and or some other values.
Code: |
<IfModule fcgid_module>
FcgidInitialEnv PATH "c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 40
FcgidConnectTimeout 10
FcgidMaxProcesses 8
FcgidOutputBufferSize 64
ProcessLifeTime 240
FcgidMaxRequestsPerProcess 500
FcgidMinProcessesPerClass 0
<Files ~ "\.php$>"
AddHandler fcgid-script .php
SetEnv PHPRC "C:/php"
FcgidWrapper "C:/php/php-cgi.exe" .php
</Files>
</IfModule>
|
|
|
Back to top |
|
mrcullers
Joined: 16 Jun 2012 Posts: 22 Location: USA, Bradenton FL
|
Posted: Mon 02 Jul '12 13:37 Post subject: |
|
|
Seriously awesome! Thank You!
You know when you get use to upgrading all the time, sometimes you forget to take a look at the readme files and look over the instructions to make sure their are no changes before reusing older setups from older packages. I have fallen victim once again.
Was using the previous IfModule fcgid_module frame work in config.
Thank you, now I have both x64 PHP and x32 PHP working now. |
|
Back to top |
|
Morpheus
Joined: 09 May 2012 Posts: 2 Location: USA, Wilmington
|
Posted: Tue 23 Oct '12 2:55 Post subject: Unable to print out a PHP test |
|
|
I'm just beginning to convert from 32bit to 64bit. Apache 2.4.3 has been working fine with the 32bit version of PHP 5.4.7, and the matching php5apache2_4.dll from the Apache Lounge.
In my original Apache 32bit httpd.conf file I added at the very bottom:
Code: | LoadModule php5_module d:/winids/php/php5apache2_4.dll
AddType application/x-httpd-php .php
PHPIniDir d:/winids/php |
Now I've replaced the above with the below:
Code: | <IfModule fcgid_module>
FcgidInitialEnv PATH "D:/winids/php;D:/winids/php/pear;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 40
FcgidConnectTimeout 10
FcgidMaxProcesses 8
FcgidOutputBufferSize 64
ProcessLifeTime 240
FcgidMaxRequestsPerProcess 500
FcgidMinProcessesPerClass 0
<Files ~ "\.php$>"
AddHandler fcgid-script .php
SetEnv PHPRC "D:/winids/php"
FcgidWrapper "D:/winids/php/php-cgi.exe" .php
</Files>
</IfModule> |
When I use explorer and hit the webserver it states 'It Works!'. Now I place my test.php file in the root of the webserver and hit it with Explorer, and all I get is a white screen.
Quote: | <?php
phpinfo();
?> | My test script above.
Any Ideas on this one?
Also, do I need to place these variables (D:/winids/php;D:/winids/php/pear;) in the path statement above? I have already added them into the php.ini file, and into the Windows environmental variables. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 23 Oct '12 10:19 Post subject: |
|
|
yepp, you forgot that fcgid needs to be executed.
Code: |
<IfModule fcgid_module>
FcgidInitialEnv PATH "D:/winids/php;D:/winids/php/pear;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 40
FcgidConnectTimeout 10
FcgidMaxProcesses 8
FcgidOutputBufferSize 64
ProcessLifeTime 240
FcgidMaxRequestsPerProcess 500
FcgidMinProcessesPerClass 0
<Files ~ "\.php$>"
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
SetEnv PHPRC "D:/winids/php"
FcgidWrapper "D:/winids/php/php-cgi.exe" .php
</Files>
</IfModule>
|
|
|
Back to top |
|
Morpheus
Joined: 09 May 2012 Posts: 2 Location: USA, Wilmington
|
Posted: Tue 23 Oct '12 17:18 Post subject: |
|
|
I'm now trying to get Apache x64 to talk to the 32bit version of PHP. Seeing Apache x64 can not use the php5apache2_4.dll because it's 32bit, and this is how I got it to work.
These are the support files I used. This was a new install on a Server 2008 R2.httpd-2.4.3-win64.zip
php-5.4.7-Win32-VC9-x86.zip
mod_fcgid-2.3.7-win64.zip After installing and configuring Apache, and PHP I extracted the mod_fcgid.so from the mod_fcgid-2.3.7-win64.zip file, and copied it to the Apache24/modules folder.
I then had to edit the httpd.conf files and include the below afer the last LoadModule entry.
Code: | LoadModule fcgid_module modules/mod_fcgid.so |
I then had to enter the code below at the end of the httpd.conf file. There will be path changes to be made. Code: | <IfModule fcgid_module>
FcgidInitialEnv PHPRC "D:\\winids\\php"
FcgidInitialEnv PATH "D:\\winids\\php;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;"
FcgidInitialEnv SystemRoot "C:\\Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:\\WINDOWS\\TEMP"
FcgidInitialEnv TMP "C:\\WINDOWS\\TEMP"
FcgidInitialEnv windir "C:\\WINDOWS"
FcgidIOTimeout 40
FcgidConnectTimeout 10
FcgidMaxProcesses 8
FcgidOutputBufferSize 64
ProcessLifeTime 0
FcgidMaxRequestsPerProcess 0
FcgidMinProcessesPerClass 0
FcgidMaxProcesses 50
FcgidFixPathinfo 1
FcgidZombieScanInterval 20
FcgidMaxRequestLen 536870912
FcgidIOTimeout 120
<Files ~ "\.php$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "D:/winids/php/php-cgi.exe" .php
</Files> |
I have now successfully pulled up (http://winids/phpinfo.php) the information page about the current PHP version. |
|
Back to top |
|