Jump to content

PHP installation help


Recommended Posts

I'm trying to learn PHP and am trying to set up Apache and I changed the httpd.conf file and added:

 

LoadModule php5_module c:/php5/php5apache2_2.dll

 

I tried putting a practice file in my htdocs folder and tried to open in a browser, but it won't recognize it...

 

Ok... when I try to start Apache now, it says:

 

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  shutting down

Link to comment
Share on other sites

That error basically means something else is running on port 80 and so Apache cannot listen on that port. Without a port Apache cannot run. Apache uses port 80 by default for TCP/IP requests.

 

Either stop the application/service that is using port 80 or configure Apache to use a different port such as port 8080 by changing the Listen directive in the httpd.conf from:

Listen 80

to

Listen 8080

 

Save httpd.conf and restart Apache. Open your web browser and go to http://localhost:8080/

Link to comment
Share on other sites

What is your DocumentRoot set to? By default it'll be set to something like C:/Program Files/Apache Foundation/Apache2/htdocs (If you used the default installation path when installing Apache) you must place all your web related files in that folder. This is where Apache serves the files from when you got to localhost.

 

Also remove all existing files in the htdocs folder. That way when you go to localhost you'll see a list of files and folders currently located in your DocumentRoot rather than a  "It Works" page.

 

If you are creating your php files in Notepad or similar editor make sure you set the File Type dropdown box to All Files. Otherwise the editor may add on .txt to the end of the file name. Which will result in your php file being named filename.php.txt and not filename.php. Windows has habit of hiding file extensions from filenames when viewing files in a folder in Windows Explorer. I always disable the option called "Hide extensions for known file types" in Tools > Folder Options > General

Link to comment
Share on other sites

Can you attach Apaches httpd.conf file here. Maybe you have a stray mis-configuration setting. I'm not sure what else to suggest.

 

Make sure you are going http://localhost:8080/ and not just http://localhost/ when viewing phpinfo.php. ALso did you remove all files in D:/apache2/htdocs ? What  is displayed when you go to localhost? You should see all files and folders stored in your htdocs folder.

Link to comment
Share on other sites

Remember earlier I got you you to change the port Apache listens too for TCP/IP requests, you changed it to 8080 instead of using the default which was 80. Anytime you go to localhost now you must state the port number too.

 

Glad everything is working now.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.