logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Issue with Apache and PHP testing, need help.....
Author
GOLDSPARK27



Joined: 14 Mar 2013
Posts: 6
Location: LONDON

PostPosted: Thu 14 Mar '13 1:09    Post subject: Issue with Apache and PHP testing, need help..... Reply with quote

I haven't done a search to find an answer to the problem I am having with installation, but after having posted my problem on other forums, it seems no one is familiar with installing Apache and PHP, so here it is, my problem:

httpd-2.4.4-win32.zip when I extract this file I have the folder Apache24 (and all the files within)

I placed the folder in C:/Apache24

I configured the conf.httpd file to change the ports to be listened to (as mentioned before), I also added the following line to the bottom of the file
LoadModule php5_module "c:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"
As instructed.

I also installed PHP 5.4.12, moved the folder to c:/php

I went into my system environment variables and added this in path: ;c:\php;c:\apache24;c:\apache24\bin;

Apache 2.4 now starts and at the bottom I see Apache/2.4.4(Win32)PHP/5.4.12, not sure if that means its working properly now, as when I go to test it with a file I created in php:

#http://localhost/info.php

no information about PHP appears in my browser like I was told it should.

Also I get these errors when I run the apache test configuration file:

The Apache service named reported the following error:
>>> Unable to open logs .

The Apache service named reported the following error:
>>> no listening sockets available, shutting down .

The Apache service named reported the following error:
>>> (OS 10048)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:8888 (no other service or application is using this port number)
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 14 Mar '13 1:27    Post subject: Re: Issue with Apache and PHP testing, need help..... Reply with quote

GOLDSPARK27 wrote:

The Apache service named reported the following error:
>>> Unable to open logs .

The Apache service named reported the following error:
>>> no listening sockets available, shutting down .

The Apache service named reported the following error:
>>> (OS 10048)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:8888 (no other service or application is using this port number)


These simply mean, Apache is already running, or there is some other software listening on Port 8888.

Because of this >>> Unable to open logs, I'll assume Apache is already running.

but then you will have to use
http://localhost:8888/info.php

to speak to Apache if it's listening on port 8888.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Thu 14 Mar '13 13:24    Post subject: Reply with quote

Create the directory C:\Apache24\logs to get rid about the error on not being able to open the logs.
Back to top
GOLDSPARK27



Joined: 14 Mar 2013
Posts: 6
Location: LONDON

PostPosted: Fri 15 Mar '13 5:45    Post subject: Reply with quote

Where exactly do I create this directory?

In the Apache24 folder there is a logs folder, which contains the following files:

error.log and access.log
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 18 Mar '13 16:18    Post subject: Reply with quote

What folder seems to be correct. Did you install apache as service?
Back to top
GOLDSPARK27



Joined: 14 Mar 2013
Posts: 6
Location: LONDON

PostPosted: Tue 19 Mar '13 3:54    Post subject: Reply with quote

yes Apache actually runs and starts as a service

The problem is it seems to all be ok, but when I got to put:

http://localhost:8888/info.php

I get nothing in the browser.

I changed the port from 80 to 8888 to be listen and
serverName changed it to :8888 (www.localhost.com:8888), but I get nothing on the browser when I try to test it.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 20 Mar '13 13:06    Post subject: Reply with quote

you may post your error log at pastebin.com So we can have a look at it.
Did you restart the server after changing the config? You have any vhosts?
Which url do you try to open in your browser? www.localhost.com:8888?? Why not just http://localhost:8888 ?
Back to top
GOLDSPARK27



Joined: 14 Mar 2013
Posts: 6
Location: LONDON

PostPosted: Wed 20 Mar '13 22:47    Post subject: Reply with quote

I first tried localhost:8888 that didn't work, so I then tried www.localhost.com:8888, because thats what I changed the serverName to

serverName www.localhost.com:8888

before that I had put :8888, but didn't work so tried something different.

I've never used pastebin before.

After making changes to the necessary files I restarted apache and started the service again, it all seemed to work fine until when I tried to test it, I couldn't view my info.php file I created to test it.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 21 Mar '13 11:00    Post subject: Reply with quote

www.localhost.com will not work unless you change your DNS resolving via DNS server or your hosts file.

Well http://pastebin.com/ is just something where you can post your config without flooding this forum and we can take a look Wink

Quote:

it all seemed to work fine until when I tried to test it


means what? apache starts? You can see static files?

Quote:

I couldn't view my info.php file I created to test it.


You get a blank page or a 404 ?
Back to top
GOLDSPARK27



Joined: 14 Mar 2013
Posts: 6
Location: LONDON

PostPosted: Thu 21 Mar '13 19:56    Post subject: Reply with quote

Ok it seems to work ok now, but only when I insert

http://localhost:8888 in the browser

BUT!

when I insert http://localhost:8888/info.php

I don't get anything, it just stays loading.

I have my info.php file in the Apache24 directory, is this where it needs to be to show in the browser?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 22 Mar '13 10:35    Post subject: Reply with quote

GOLDSPARK27 wrote:

I have my info.php file in the Apache24 directory, is this where it needs to be to show in the browser?


it should be into the htdocs folder.
Back to top
dhiekanug



Joined: 16 Mar 2013
Posts: 5

PostPosted: Tue 26 Mar '13 5:21    Post subject: Reply with quote

i have same problem, apache running well, but when i test to open php file (http://localhost/phpinfo.php) browser only loading and no result

any suggestion?
Back to top
dhiekanug



Joined: 16 Mar 2013
Posts: 5

PostPosted: Tue 26 Mar '13 5:38    Post subject: Reply with quote

response myself Smile

my php could running well now, i have PHP 5.4.5-Win64 which not have php-ini file, and when i put php-ini file in php folder, it works now

thx all
Back to top
NetLost



Joined: 19 Aug 2006
Posts: 6
Location: Suffolk, UK

PostPosted: Fri 05 Apr '13 18:36    Post subject: Re: Issue with Apache and PHP testing, need help..... Reply with quote

My problem is similar. Loaded Apache in C/Server/Apache, set conf., and subsequently PHP.ini in C/Server/PHP on Windows 8. HTML with CSS and Javascript work properly from htdocs when called by localhost/.... However only the PHP code is displayed in test browsers.

Following much research and faqs looked at setup on my old computer installed about 6-7 years ago for Apache,PHP,MySql. There are php.dll and php.ini files in Windows/System and Windows/System32 respectively. On this new 64bit machine Windows/System is empty, Windows/System32 there is php5ts.dll which I copied accross. Still only get <?php PHPInfo() ?> displayed in browsers from localhost.

Somehow Windows and/or Apache are not finding PHP. Hope this helps as if it does, it will also help me.

NetLost
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 05 Apr '13 19:40    Post subject: Reply with quote

Post XP there's a good chance (unless you were logged in as Administrator) that php5ts.dll & php.ini are not really in the Windows folder but in c:\users\username\appdata\local\virtualstore\windows

There really is no need to have them there anymore anyway.

Here's my config for PHP 5.4 on Apache 2.4, adjust paths to yours

Code:
LoadModule php5_module c:/php54/php5apache2_4.dll
<IfModule php5_module>
PHPIniDir c:/php54
AddHandler application/x-httpd-php .php
</IfModule>
Back to top
NetLost



Joined: 19 Aug 2006
Posts: 6
Location: Suffolk, UK

PostPosted: Sun 07 Apr '13 19:07    Post subject: Reply with quote

glsmith wrote:
Great!! Changed paths to mine, inserted the <ifmodule in the conf and deleted PHPIniDir from conf body. All working fine.

Nothing in the Windows paths.

Many thanks
Back to top


Reply to topic   Topic: Issue with Apache and PHP testing, need help..... View previous topic :: View next topic
Post new topic   Forum Index -> Other Software