I'm setting up an development environment on a Windows 8.1 machine. I successfully installed Apache 2.2, and downloaded php-5.6.3-Win32-VC11-x86. I added the following lines at the end of httpd.conf PHPIniDir 'C:/PHP5' LoadModule php5module 'C:/PHP5/php5apache24.dll' AddType application/x-httpd-php.php AddHandler application/x-httpd-php.php I also added application/x-httpd-php.php to the myme.types file If I comment out PHPIniDir or LoadModule apache will start normally. Also, all extensions are commented out on the PHP.ini file, and the extension directory is set as extensiondir = 'ext' Any help will be hugely appreciated.
EDIT 1: The only thing in error log is about server shutdow Sun Nov 23 14: notice Parent: Received shutdown signal - Shutting down the server. Sun Nov 23 14: notice Child 6192: Exit event signaled. Child process is ending. Sun Nov 23 14: notice Child 6192: Released the start mutex Sun Nov 23 14: notice Child 6192: All worker threads have exited.
Er diagram of petrol pump management system. Sun Nov 23 14: notice Child 6192: Child process is exiting Sun Nov 23 14: notice Parent: Child process exited successfully.
I have a new VPN with Ubuntu server 10.04 LTS which came with Mysql 5.1 installed, that was not supporting Barracuda file formats, so I manually installed and configured Mysql 5.6. Which works perfectly so far. Apache2 is working well too, so far (haven't been testing it a lot but seems stable). Only thing is that PHP5 was not recognising the module for PDO, so i removed it. Is there a way I can MANUALLY install PHP5 or any version of PHP on Ubuntu? If I do apt-get install php5 it says root@vps:/etc# sudo apt-get install php5 Reading package lists.
Done Building dependency tree Reading state information. Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: php5: Depends: libapache2-mod-php5 (= 5.3.10-1ubuntu3.8) but it is not going to be installed or libapache2-mod-php5filter (= 5.3.10-1ubuntu3.8) but it is not going to be installed or php5-cgi (= 5.3.10-1ubuntu3.8) but it is not going to be installed or php5-fpm (= 5.3.10-1ubuntu3.8) but it is not installable E: Broken packages. I have tried, and in the process, following other links from stackoverflow i crashed my VPN:)) was Ubuntu 10.04 and had native support for Mysql 5.1 which i didn't like.it was my mistake anyways, one Php5 link install suggested some commands that actually were trying to upgrade my Ubuntu, and I didnt know.I now asked them to install me Ubuntu 12.04 which has native support for Mysql 5.5, which is acceptable.but I will take all your comments into consideration for future events – Dec 8 '13 at 17:55. You could use a ppa to stay up-to-date with php.
I use: It's now on 5.5 and also includes Apache 2.4 update. For Apache 2.2 + PHP 5.4 repository, see the bottom of the answer. If you want use this ppa do this: ( sudo add-apt-repository ppa:ondrej/php5 sudo apt-get update sudo apt-get upgrade If you don't have add-apt-repository binary do the following: sudo apt-get install python-software-properties Precautions: For Ubuntu 12.10 Ubuntu 12.10's official repository to php 5.4.
You should use the main repository package if you can. To do this, just install Install php5 without enabling any PPA. PHP 5.4 Prepackaged latest PHP 5.4 now resides in separate PPA.
I just want to make you aware that PHP has reached it's EOL (End of Life) and no longer provide security updates or bugfixes which could be critical to your environment. If you need to run PHP 5.x, I'd suggest you looking at 5.6, or follow the migration guide. Have a look at: If you really want to to compile your own version.
Make sure you have a compiler and standard libraries available. Apt install build-essentials. Download each individual tarball for the AMP stack and install their dependencies. Blacklist any Apache, PHP packages etc in your dpkg/apt config.
How to Install and Configure PHP 5 to Run with Apache on Windows by Christopher Heng, Many web developers want to run Apache and PHP on their own computer since it allows them to easily test their scripts and programs before they put them 'live' on the Internet. This article gives a step by step guide on how you can install and configure PHP5 to work together 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. If you just want a quick and easy way to install the latest versions of Apache, PHP and MySQL, you may want to consider using my other guide. It's really much easier, since it uses a package that has all those software integrated and pre-configured.
If you are using Apache 1.3.x, see the guide. If you plan to use one of the Apache 2 or 2.2 web servers on Windows XP, see the tutorial instead. If you are using Apache 2.2 on Windows Vista, please read. Note: those planning to install PHP 4 on Apache 1.x should read my article instead. Steps to Setting Up PHP 5. Download PHP 5 Before you begin, get a copy of PHP 5 from.
In particular, download the VC6 thread-safe zip package from the 'Windows Binaries' section — that is, don't get the installer. For example, select the package labelled 'PHP 5.2.5 zip package' if 5.2.5 is the current version. Update: note that I have not tested the procedure below with any of the PHP 5.3 versions, only with 5.2.5, which was the latest version at the time I originally wrote this. In theory, the procedure should work with later 5.2 versions as well. I'm not sure about 5.3 though.
A version jump from 5.2 to 5.3 usually means bigger changes than simple bug fixes. If you want to be sure the procedure below will work, just get the latest of the 5.2 series. Install PHP 5 Create a folder on your hard disk for PHP.
I suggest 'c: php' although you can use other names if you wish. Personally though, I prefer to avoid names with spaces in it, like 'c: Program Files php' to avoid potential problems with programs that cannot handle such things. I will assume that you used c: php in this tutorial. Extract all the files from the zip package into that folder.
To do that simply double-click the zip file to open it, and drag all the files and folders to c: php. Upgraders: Remove the Old PHP.INI File from Your Windows Directory If you are upgrading to PHP 5 from an older version, go to your windows directory, typically c: windows, and delete any php.ini file that you have previously placed there. Configuring PHP Go to the c: php folder and make a copy of the file 'php.ini-recommended'.
Name the new file 'php.ini'. That is, you should now have a file 'c: php php.ini', identical in content with 'c: php php.ini-recommended'. Note: if you are using Apache 1, you should either move the php.ini file to your windows directory, 'C: Windows' on most systems, or configure your PATH environment variable to include 'c: php'. If you don't know how to do the latter, just move the php.ini file to the 'c: windows' folder.
You do not have to do this if you are using Apache 2, since we will include a directive later in the Apache 2 configuration file to specify the location of the php.ini file. Use a (such as Notepad, which can be found in the Accessories folder of your Start menu) to open 'php.ini'. You may need to make the following changes to the file, depending on your requirements:.
Enable Short Open Tags Search for the line that reads. Shortopentag = Off If shortopentag is set to 'off', tags like '. Magicquotesgpc = On Do not do this unless your web host has this setting as well. Even with the setting of 'Off', you can still use the addslashes function in PHP to add the slashes for the specific pieces of data that need them. Register Globals A number of older scripts assume that all data sent by a form will automatically have a PHP variable of the same name.
For example, if your form has an input field with a name of 'something', older PHP scripts assume that the PHP processor will automatically create a variable called $something that contains the value set in that field. If you are running such scripts, you will need to look for the following field. Registerglobals = On WARNING: Do NOT do this unless you have third party scripts that need it. When writing new scripts, it's best to always code with the assumption that the registerglobals item is set to 'Off'. Display Errors On a 'live' website, you typically want errors in your script to be silently logged to a PHP error file. On your own local machine, however, while you are testing and debugging a PHP script, it is probably more convenient to have error messages sent to the browser window when they appear.
If you do not have an Avid account you will need to create one prior to activation. For additional information regarding activation, you my go here: Other Helpful Links: • • • • • • * European Users. If you received an activation card with your product, activation is completed by logging into your Avid account here. Daemon tools serial number generator. Please be sure to locate all cards to ensure complete registration.
This way, you won't miss errors if you forget to check the error log file. If you want PHP to display error messages in your browser window, look for the following.
Session.savepath = 'c: tmp' Notice that in addition to changing the path, I also removed the semi-colon (';') prefix from the line. Alternatively, you can find out the current TEMP folder on your computer and use that. Or create a 'tmp' folder in your PHP directory, like 'c: php tmp' and set the configuration file accordingly. The possibilities are endless. If you can't decide, just create 'c: tmp' and do as I said above. SMTP Server If your script uses the mail function, and you want the function to successfully send mail on your local machine, look for the following section.
mail function SMTP = mail.example.com smtpport = 25 sendmailfrom = [email protected] Note that after you do this, when your script tries to use the mail function, you will need to be connected to your ISP for the function to succeed. If you do not modify the above lines and attempt to use mail in your script, the function will return a fail code, and display (or log) the error (depending on how you configure php.ini to handle errors). (Note that in Apache 1.x, the smtpport line may not be present. If so, don't include it.) 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 to configure it to run the interpreter as a CGI binary. I will supply information for how you can accomplish both, but you should only implement one of 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 implemented it to run as a CGI binary. Running PHP 5 as an Apache Module To configure Apache to load PHP as a module to parse your PHP scripts, use an ASCII text editor to open the Apache configuration file, 'httpd.conf'. If you use Apache 1.x, the file is found in 'c: Program Files Apache Group Apache conf '. Apache 2.0.x users can find it in 'C: Program Files Apache Group Apache2 conf ' while Apache 2.2.x users can find it in 'C: Program Files Apache Software Foundation Apache2.2 conf '. Basically, it's in the 'conf' folder of wherever you installed Apache. Search for the section of the file that has a series of 'LoadModule' statements.
Statements prefixed by the hash '#' sign are regarded as having been commented out. If you are using Apache 1.x, add the following line after all the LoadModule statements. PHPIniDir 'c:/php' Of course if you used a different directory for your PHP installation, you will need to change 'c:/php' to that path. Remember to use the forward slash ('/') here again.
Apache 2.2 Download
If you are using Apache 1, you will have already placed your php.ini file in either the Windows directory or somewhere in your PATH, so PHP should be able to find it by itself. You can of course do the same if you are using Apache 2, but I find modifying the Apache configuration file a better solution than cluttering your c: windows directory or your PATH variable. Running PHP 5 as a CGI Binary If you have configured PHP 5 to run as an Apache module, skip forward to the next section. This section is for those who want to configure PHP to run as a CGI binary.
The procedure is the same whether you are using the Apache 1.x series or one of the 2.x series. Search for the portion of your Apache configuration file which has the ScriptAlias section.
Add the line from the box below immediately after the ScriptAlias line for 'cgi-bin'. If you use Apache 2.2.x, make sure that the line goes before the closing for that section. Note that if you installed PHP elsewhere, such as 'c: Program Files php ', you should substitute the appropriate path in place of 'c:/php/' (for example, 'c:/Program Files/php/'). Observe carefully that I used forward slashes ('/') instead of the usual Windows backslashes (' ') below. You will need to do the same. AllowOverride None Options None Order allow,deny Allow from all. Configuring the Default Index Page This section applies to all users, whether you are using PHP as a module or as a CGI binary.
If you create a file index.php, and want Apache to load it as the directory index page for your website, you will have to add another line to the 'httpd.conf' file. To do this, look for the line in the file that begins with 'DirectoryIndex' and add 'index.php' to the list of files on that line. For example, if the line used to be. DirectoryIndex index.php index.html The next time you access your web server with just a directory name, like 'localhost' or 'localhost/directory/', Apache will send whatever your index.php script outputs, or if index.php is not available, the contents of index.html. 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 into the httpd.conf file. The Apache 2.2 server can be restarted by doubleclicking the Apache Service Monitor system tray icon, and when the window appears, 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 are using 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's address 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 PHP to interpret your script. If all goes well, you should see a pageful of information about your PHP setup. Congratulations — you have successfully installed PHP and 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 has set 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 your Apache 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: php php-cgi test.php' (without the quotes). If invoking PHP from the command line causes a large HTML file with all the PHP configuration information to be displayed, then your PHP set up is fine. The problem probably lies with your Apache 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 this page and the steps given in (for Apache 1.x users), (for Apache 2.x users on Windows XP) or (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 to it online or download the entire set of HTML files for reference offline. As its name implies, it is a reference manual only.
For tutorials, check out at thesitewizard.com. If you are new to writing PHP scripts, the following chapters may interest you:. gets you on your feet quickly with writing a useful and functional PHP script. introduces more features of PHP in a practical, usable way. deals with how to avoid a security hole in PHP scripts that use the mail function. Copyright © 2007-2017 by Christopher Heng. All rights reserved.
Get more free tips and articles like, on web design, promotion, revenue and scripting, from. You are here: Other articles on:, thesitewizard™ News Feed (RSS Site Feed) Do you find this article useful? You can learn of new articles and scripts that are published on by subscribing to the RSS feed.
Simply point your RSS feed reader or a browser that supports RSS feeds. You can from my. Please Do Not Reprint This Article This article is copyrighted. Please do not reproduce or distribute this article in whole or part, in any form. Related Pages. New Articles.
Popular Articles. How to Link to This Page To link to this page from your website, simply cut and paste the following code to your web page. How to Install and Configure PHP 5 to Run with Apache on Windows It will appear on your page as.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |