Yes, I can't update to apache 2.4.x and PHP 5.4 seems to be the newest version still supporting apache 2.2. Tried a lot more version combinations without any luck so now I'm wondering: is php 5.4 incompatible with apache 2.2.X?
![]()
# AWS EC2# Remove Apache and PHP old version# Install Apache 2.4, ModSSL and PHP 5.6#sudo service httpd stopsudo yum erase httpd httpd-tools apr apr-utilsudo yum remove php-.sudo yum install php56sudo yum install php56-xml php56-xmlrpc php56-soap php56-gd php56-mbstringsudo yum install php56-mysqlndsudo yum install mod24sslsed -i -e 's/SSLMutex/Mutex/g ' /etc/httpd/conf.d/ssl.confsudo service httpd startsudo service httpd restart## Update Apache, ModSSL and PHP##sudo yum update php56#sudo yum update mod24ssl#sudo yum update httpd httpd-tools.
by Christopher Heng, thesitewizard.com ![]()
Many web developers want to run Apache and PHP on their own computer since it allows them to easily test their scripts and programsbefore they put them 'live' on the Internet. This article gives a step by step guide on how you can install and configure PHP5 to worktogether with the Apache HTTP Server on Windows. The procedure has been tested to work on both Windows XP and Vista.
If you have not already installed Apache on your machine, check out one of the guides listed below. This'How To' guide assumes that you have already completed installing Apache.
Note: those planning to install PHP 4 on Apache 1.x should read my articleHow to Install and Configure PHP4 to Run with Apache on Windowsinstead.
Steps to Setting Up PHP 5
How to Configure Apache for PHP 5
There are two ways to set up Apache to use PHP: the first is to configure it to load the PHP interpreter as an Apache module. The second is toconfigure it to run the interpreter as a CGI binary. I will supply information for how you can accomplish both, but you should only implement oneof these methods. Choose the module method if your web host also installed PHP as an Apache module, and use the CGI method if they have implementedit to run as a CGI binary.
Restart the Apache Web Server
Restart your Apache server. This is needed because Apache needs to read the new configuration directives for PHP that you have placed intothe httpd.conf file. The Apache 2.2 server can be restarted by doubleclicking the Apache Service Monitor system tray icon, and when the windowappears, clicking the 'Restart' button.
Testing Your PHP Installation
Create a PHP file with the following line:
Save the file as 'test.php' or any other name that you fancy, but with the '.php' extension, into your Apache htdocs directory. If you areusing Notepad, remember to save as 'test.php' with the quotes, or the software will add a '.txt' extension behind your back.
Open your browser and access the file by typing 'localhost/test.php' (without the quotes) into your browser'saddress bar. Do not open the file directly on the hard disk — you'll only see the words you typed in earlier.You need to use the above URL so that the browser will try to access your Apache web server, which in turn runs PHPto interpret your script.
If all goes well, you should see a pageful of information about your PHP setup. Congratulations — you have successfully installed PHPand configured Apache to work with it. You can upload this same file, test.php, to your web host and run it there to see how your web host hasset up his PHP, so that you can mimic it on your own machine.
If for some reason it does not work, check to see whether your PHP setup or yourApache setup is causing the problem. To do this, open a Command Prompt window (found in the 'Accessories' folder of your 'Start' menu)and run php-cgi.exe on test.php with a command line like 'c:phpphp-cgi test.php' (without the quotes).
If invoking PHP from the command line causes a large HTML file with all the PHP configurationinformation to be displayed, then your PHP set up is fine. The problem probably lies with yourApache configuration. Make sure that you have restarted the Apache server after making configuration changes.Verify that you have configured Apache correctly by looking over, again, the instructions on thispage and the steps given in How to Installand Configure Apache 1.x for Windows (for Apache 1.x users),How to Install andConfigure Apache 2 on Windows (for Apache 2.x users on Windows XP) orHow to Install Apache 2.2on Windows Vista (for Apache 2.2.x on Windows Vista and above).
Learning PHP
The complete PHP reference manual can be obtained from the php website. You can refer toit online or download the entire set of HTML files for reference offline. Asits name implies, it is a reference manual only. For tutorials, check outthe PHP tutorials at thesitewizard.com. If you are new to writingPHP scripts, the following chapters may interest you:
Have fun!
Copyright © 2007-2018 by Christopher Heng. All rights reserved.
Get more free tips and articles like this,on web design, promotion, revenue and scripting, from https://www.thesitewizard.com/.
Do you find this article useful? You can learn of new articles and scripts that are published onthesitewizard.comby subscribing to the RSS feed. Simply point your RSS feed reader or a browser that supports RSS feeds athttps://www.thesitewizard.com/thesitewizard.xml.You can read more about how to subscribe toRSS site feeds from my RSS FAQ.
This article is copyrighted. Please do not reproduce or distribute this article in whole or part, in any form.
It will appear on your page as:
Copyright © 2007-2018 by Christopher Heng. All rights reserved. thesitewizard™, thefreecountry™ and HowToHaven™ are trademarks of Christopher Heng. This page was last updated on 24 May 2018. ![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |