I've been running a development site with Apache 2.2, PHP5.2 and MySql using, in part, software obfuscated with ZendGuard (version unknown). The actual online hosting sight is discontinuing PHP5.2 forcing an upgrade to PHP5.4. I've ended up uninstalling Apache and PHP. I can get Apache 2.4 running; however, if I understand right ZendGuard requires a non thread safe version of PHP5.4. I can not figure out how to install PHP5.4 nts on my Windows pc to work with Apache2.4.
Here's the link to the non thread safe windows pre-compiled version of PHP
For Apache on Windows, it's recommended to use the VC11 Apache lounge build: here
You'll need to add the following lines in Apache's httpd.conf:
LoadModule php5_module "c:/php/php5apache2_2.dll" #or wherever you put it
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php" #your path
I'm not too familiar with ZendGuard, but once you have the Apache server configured for php I'm sure it will just be a case of trivial configuration.
Related
My Server : Win server 2012 64bit, Apache 2.4 64bit, PHP Version 5.6.13 (x64)
After install Apache 2.4, i can start normal.
But If i add PHP to httpd.conf
PHPIniDir "C:\php"
LoadModule php5_module "C:\php\php5apache2_4.dll"
I can't start apache, it show message:
Windows could not start the Apache2.4 on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 1.
why can't start apache if add PHPIniDir Setting to httpd.conf?
I test on Win 7, it is ok.
The cause : my php using php_com_net.dll
So i have to install: MSVC11 (Visual C++ 2012)
I'm using a stand alone server (Not connected to the internet) which contains Apache server (httpd service) and php version 5.5 (installed with ./configure, make & make install).
This 2 applications were installed separately.
How can I config my Apache server to work with that php?
Unfortunately I can't use yum.
Thanks.
You have apache and php already installed on your server. So you just need to configure apache to work with PHP.
Configure Apache to run PHP as a Module
Add the following line in httpd.conf file if it's not already there,
LoadModule php5_module modules/libphp5.so
Tell Apache to parse certain extensions as PHP
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
And restart apache (httpd) server,
service httpd restart
refer php.net for more details.
Is there any restriction between apache and php version? Suppose I am running Apache version 2.2. Am I restricted to certain PHP version (5.3?) such that beyond that version (5.4 or 5.5), PHP can't be run as an apache module?
To be more specific, is mod_php bound to certain PHP version?
In general Apache doesn’t care what version of PHP you are using and PHP doesn’t really care what version of Apache you are using. I say “in general”, because there can be some extreme cases where you will most likely know you are getting into a mess before you even begin. But for common use, it’s not a worry.
For example, on my desktop I am using MAMP running Apache version 2.2.25 and PHP 5.5.3. In fact I can toggle MAMP to use PHP 5.2.17 if need be. And in other setups you can have dozens of different PHP module versions you can select to load into Apache. Using Ubuntu 12.04 as an example you just have to edit this file:
/etc/apache2/mods-available/php5.load
And have it load whatever PHP module you wish to load:
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
The name libphp5.so has little to do with the contents. That is the name the file is given when compiled. For my own testing purposes when manually compiling I have renamed libphp5.so all of the following & it always worked fine:
LoadModule php5_module /usr/lib/apache2/modules/libphp535.so
LoadModule php5_module /usr/lib/apache2/modules/libphp533-gd.so
LoadModule php5_module /usr/lib/apache2/modules/libphp530-gd.so
LoadModule php5_module /usr/lib/apache2/modules/libphp529-gd.so
LoadModule php5_module /usr/lib/apache2/modules/libphp525-gd.so
LoadModule php5_module /usr/lib/apache2/modules/libphp516-gd.so
And I have even manually compiled PHP 5.1.6 —painful but doable & necessary for a project—on an Ubuntu 12.04 setup running Apache 2.2.25 without any issue. The biggest issue I ran into when compiling PHP 5.1.6 was simply ensuring I had the proper libraries loaded or installed on the system. But that is a nightmare you don’t want to know about!
In general, an upgrade from PHP 5.3 to PHP 5.4 or 5.5 should be a relatively easy process. No worries.
I'm having trouble with Apache/PHP on Windows 8. I have previously been using them on XP (along with MySQL) with no problems. I never used Windows 7.
Apache installs without issues. Everything works OK, including all my virtual servers.
PHP installs OK, the installation puts entries into httpd.conf without giving errors.
However, when I try to load Apache after installing PHP, Apache won't load.
I'm confused by the error that Apache returns when the PHP entries are included in httpd.conf:
Syntax error on line 1029 of C:/Program Files/Apache Group/Apache2/conf/httpd.conf:
Cannot load C:/Program Files/PHP/php5apache2_2.dll into server: The specified module could not be found.
The lines are:
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:\Program Files\PHP\"
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
(line 1029 is the LoadModule line).
That location for the dll is definitely correct. The syntax of the line is as inserted by PHP. I have compared the syntax to previous versions of httpd.conf that I have and it appears correct. I think the syntax error is a red herring.
I have tried:
Switching backslashes to slashes in the dll location.
Adding PHP to the path.
Installing Apache and PHP in both sequences.
Checking the permissions to the PHP folder and the individual files
to ensure that SYSTEM has read/execute.
Comment out the PHP lines and Apache loads fine. If I comment out the LoadModule line and and just leave the PHPIniDir line, it still fails. Apache seems to be behaving as though it can't see the PHP directory, but I can't work out why.
There is nothing on the Windows event log. Latest versions of PHP and Apache. I'm at a bit of a loss what to try next. Any suggestions please?
Download and follow instructions from this link:
http://www.apachelounge.com/download/
The latest download (2.4) works on Windows 8 and Server 2012.
I downloaded and tested with the following on Windows 8:
Each zip has a readme.txt or install.txt with instructions.
Apache 2.4
http://www.apachelounge.com/download/win32/binaries/httpd-2.4.3-win32.zip
PHP 5.4.8
http://windows.php.net/downloads/releases/php-5.4.8-Win32-VC9-x86.zip
PHP 5.4.8 handler for Apache
http://www.apachelounge.com/download/win32/modules-2.4/php5apache2_4.dll-php-5.4-win32.zip
My httpd.conf lines that were added/modified were:
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module "C:/Apache24/php-5.4.8/php5apache2_4.dll"
LoadFile "C:/Apache24/php-5.4.8/php5ts.dll"
PHPIniDir "C:/Apache24/php-5.4.8"
<IfModule php5_module>
<Location />
AddType text/html .php
AddHandler application/x-httpd-php .php
#AddHandler application/x-httpd-php-source .phps
</Location>
</IfModule>
Its mentioned in the Readme.txt file packed with the dll's at ApacheLounge, but not anywhere else on the download page or in the filename (as all other versions):
"Runs with PHP 5.4 Thread Safe (TS), and only with Apache 2.4 Win32 VC9 or VC10"
The dlls are only for the TS version, so if you've downloaded the other one, you are basically screwed. TS php binaries fixed it for me.
GL.
Presuming this is your development, not deployment environment, why don't you just download xampp from apache friends? It should come preconfigured, and you will deploy in other setup anyway.
I ran into the similar issue when reinstalling Apache and PHP on Win 8 (I am more Linux user though). And similar to the original post, no matter what I tried to do in httpd.conf and php.ini Apache simply either did not start or did not see the PHP. After spending unreasonable amount of time, I decided to download the PHP 5.3 (5.3.27)-VC9 x86 Thread Safe (2013-Jul-10 21:56:58) Installer [45.86MB] instead of the non-tread safe version which I have been using before. There is a difference in the .msi installers. The one for the thread-safe version actually contains the required files and if you follow the installer prompts it will actually asks you if the php installation should be "linked" to Apache server. Then you just provide the hhtpd.conf directory and all works fine. Thats my 2c on this :)
I think the problem is in the blank "Program Files".
I run a Windows 7 x64 machine with apache 2.2 and PHP 5.2.17
Whenever I try to add the PHP dll to the httpd.conf file, apache will not start.
this is how it is being put into httpd.conf
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
I have successfully managed to setup and run a Apache server with PHP before, so I'm not new to this, but I'm fairly certain that this is right.
If everything that's being output on launch is the DNS error, Apache is launching just fine. FQDN resolution is a warning, not an error.