making apache server work
Posted 16 September 2006 - 08:29 PM
MYsql would be nice too, but first things first.
Do I need Apache server on my PC for PHP and MYsql to run? How do I tell my PC that PHP is there, so I can see .php files on my PC, without resorting to uploading them to my webspace?
Appreciate any help.
Posted 17 September 2006 - 01:10 PM
Installing Apache is rather easy. Make sure you download the msi package and download Apache2.0.x (don't download Apache2.2.x). When you run the Apache installer it'll ask you for a couple of details which are Network Domain ,Server Name and Administrator's Email Address
For the Network Domain and Server Name just enter localhost into the two boxes. Then just add a false email addy into the Admins Email Address eg (admin@localhost). When it ask you where to install Apache to, install it in the root of your hard drive in a folder called server, so click the browse button when it asks for installation directory, type in C:\server, the server folder will be created if it doesn't exists, also change C: to the letter of your hard drive. Now go through the rest of the installation process.
Once Apache is installed, fire up a web browser and type in http://localhost or http://127.0.0.1
The above addresses are local addresses, that only you can access. No one from the web/out side of your network can access those addresses. You should get the Apache welcome message when you go to either of the above addresses.
Now to install PHP, you'll need to go to php.net and download PHP5. Make sure you download the zipped binaries and NOT the INSTALLER. Once you have downloaded PHP. Extract the contents of the zip file to C:\server\PHP\
Once you have extracted the contents of the ZIP. PHP is installed! However you must now configure Apache to parse any PHP files with the PHP Interpreter. To do so go to C:\server\Apache2\conf and open up httpd.conf for editing.
Now look for the following:
#LoadModule ssl_module modules/mod_ssl.soAdd the following after the above:
LoadModule php5_module "C:/server/php/php5apache2.dll" #PHPIniDir PHPIniDir "C:/WINDOWS"Now scroll down further to find the following:
AddType application/x-gzip .gz .tgzNow add the following after the above:
AddType application/x-httpd-php .php
Save the httpd.conf file! What you need to do now is go to C:\server\php and find the following files:
Copy the above three files to the WINDOWS folder (C:WINDOWS\). Once you have done so. Rename php.ini-recommended to just php.ini
Now you have setup Apache to parse the PHP files with the PHP Interpreter. All you need to do now is restart Apache. To do so go to Start > Program Files > Apache HTTP Server 2.0.x > Control Apache Server > Restart
If everything goes to plan. Apache should restart without any beeps/errors popping up. If no beeps/errors come up then Apache and PHP are installed. To test go to C:\server\Apache2\htdocs\ create a new file called test.php, edit this new file and add the following code to it:
<?php phpinfo(); ?>
Save test.php. Now open up your browser again and go to http://localhost/test.php
When you go to that address you should get a page full of information about PHP and your server. If you do then Apache and PHP are successfully installed.
All you need to do now is install MySQL, which is easy as its just a step through installer. Make sure when you go to install MySQL you install it in the server folder (NOTE: You'll need to choose the custom install option to do this).
When MySQL is installed you'll need to enable the MySQL extension for PHP to use in order for you to use PHP with MySQL. You can do this by reading this thread.
Hope that helps.
Posted 20 September 2006 - 07:02 PM
Will look for php5, and out your help into practice.
Will let you know how I get on.
Thanks for replying
Posted 20 September 2006 - 08:23 PM
Posted 21 October 2006 - 03:31 PM
Not sure if you'll read this, it's been a while since my first posting, I've been hopistalised since then, so not done much PC work.
Today (21st October) I successfully installed Apache 2.0.59 and PHP5.1.6
Thanks for your help, it went smoothly except for notepad naming my testfile as test.php.txt it took me a while to figure that out
Now for MySQL.
Thanks for your help.
Posted 21 October 2006 - 04:14 PM
Posted 22 October 2006 - 06:44 PM
Seems today it now won't/doesn't want to work.
I get this error when I try to start it - Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock could not bind to address 0.0.0.0:80 no listening sockets available.
What have I done wrong or what have I not done?
Posted 23 October 2006 - 04:41 PM
Posted 24 October 2006 - 01:45 AM
I've installed MySQL, all seems OK. I cannot use it from that command line client though. Suggestions?
Posted 24 October 2006 - 05:20 PM
Then you can type mysql -u root and it should log you in to MySQL. If its doesnt then you'll need to add the -p paramter to it and then provide the password for the root user. If you dont get any think from the command then make sure MySQL is running, check your processes (Ctrl+Alt+Del click processes tab).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users