Can't Install PHP in Windows XP
Moderator: General Moderators
Can't Install PHP in Windows XP
Hi,
I haven't used PHP in a while and the last time I did it was running on Solaris servers that someone else had set up. This time I am trying to install PHP, Apache, and MySQL on my Laptop running Windows XP SP2.
I used the following tutorial: http://www.sebastiansulinski.co.uk/tuto ... windows_xp.
The tutorial suggests installing Apache, then PHP, then MySQL....It advises you on how to configure each conf file etc as you proceed. I kept my directpry names etc the same to avoid confusion.
I got Apache installed and tested by typing http://localhost:8080 which returned the Apache success page.
I then ran through the PHP install where I set the environment variables and when I typed php -v into command line it showed PHP was installed OK.
Next step was to configure Apache to run PHP as a module....This is where I am struggling.
I have edited the httpd.conf file as suggested but afterwards I test the configuration by typing http://localhost/phpinfo.php into the browser. It should return the PHP info expected but instead I get an error in Firefox saying "Problem Loading Page, Unable to Connect".
I have scanned google many times and am starting to get very confused and annoyed. I am new to this forum so not sure what information you guys need from me in order for you to be able to help so if I have missed anything please let me know.
Any help would be very much appreciated guys as I am absolutely exhausted.
Thanks again.
John.
I haven't used PHP in a while and the last time I did it was running on Solaris servers that someone else had set up. This time I am trying to install PHP, Apache, and MySQL on my Laptop running Windows XP SP2.
I used the following tutorial: http://www.sebastiansulinski.co.uk/tuto ... windows_xp.
The tutorial suggests installing Apache, then PHP, then MySQL....It advises you on how to configure each conf file etc as you proceed. I kept my directpry names etc the same to avoid confusion.
I got Apache installed and tested by typing http://localhost:8080 which returned the Apache success page.
I then ran through the PHP install where I set the environment variables and when I typed php -v into command line it showed PHP was installed OK.
Next step was to configure Apache to run PHP as a module....This is where I am struggling.
I have edited the httpd.conf file as suggested but afterwards I test the configuration by typing http://localhost/phpinfo.php into the browser. It should return the PHP info expected but instead I get an error in Firefox saying "Problem Loading Page, Unable to Connect".
I have scanned google many times and am starting to get very confused and annoyed. I am new to this forum so not sure what information you guys need from me in order for you to be able to help so if I have missed anything please let me know.
Any help would be very much appreciated guys as I am absolutely exhausted.
Thanks again.
John.
Re: Can't Install PHP in Windows XP
*cough*oble01 wrote:I got Apache installed and tested by typing http://localhost:8080 which returned the Apache success page.
[...]
I test the configuration by typing http://localhost/phpinfo.php into the browser
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Can't Install PHP in Windows XP
Moved to Installation and Configuration.
Re: Can't Install PHP in Windows XP
Thanks guys....
Tasairis....I don't get it mate?
Apologies if I'm missing somethign glaringly obvious
Tasairis....I don't get it mate?
Apologies if I'm missing somethign glaringly obvious
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Can't Install PHP in Windows XP
AH...typo there actually, I did try that previously. Since my last post I have formatted my hard drive(had to be done for other reasons), reinstalled OS, and started again using this great tutorial:
http://www.atksolutions.com/articles/in ... l_iis.html
I got IIS installed perfectly.
I got PHP installed perfectly and tested which works great.
I got mysql installed and everything seemed fine.
My final test was to run a script to check I could connect to mysql database. I used the following script:
----------------------------------------------------------------------------
<?PHP
//remember to change the password to whatever you set
//it to in mysql instance configuration
//first parameter is server name, 2nd username 'root', 3rd is password
$rst = @mysql_connect("localhost","root","root");
if (!$rst){
echo( "<p>Unable to connect to database manager.</p>");
die('Could not connect: ' . mysql_error());
exit();
} else {
echo("<p>Successfully Connected to MySQL Database Manager!</p>");
}
if (! @mysql_select_db("mysql") ){
echo( "<p>Unable to connect database...</p>");
exit();
} else {
echo("<p>Successfully Connected to Database 'MYSQL'!</p>");
}
?>
---------------------------------------------------------------------
Whenever I try to open the file (testmysql.php) in IE or Firefox I get a blank screen. I tried opening my phpinfo.php script which returns my PHP info as expected but whenever I run the above script I get a blank screen.
Does anyone have any idea what coudl be wrong? The script looks fine to me, the server name, usernam, and password are definately correct.
Any help is much appreciated guys....I have barely spoken to my wife in three days trying to get this done...Not sure how long she is going to let me away with it
http://www.atksolutions.com/articles/in ... l_iis.html
I got IIS installed perfectly.
I got PHP installed perfectly and tested which works great.
I got mysql installed and everything seemed fine.
My final test was to run a script to check I could connect to mysql database. I used the following script:
----------------------------------------------------------------------------
<?PHP
//remember to change the password to whatever you set
//it to in mysql instance configuration
//first parameter is server name, 2nd username 'root', 3rd is password
$rst = @mysql_connect("localhost","root","root");
if (!$rst){
echo( "<p>Unable to connect to database manager.</p>");
die('Could not connect: ' . mysql_error());
exit();
} else {
echo("<p>Successfully Connected to MySQL Database Manager!</p>");
}
if (! @mysql_select_db("mysql") ){
echo( "<p>Unable to connect database...</p>");
exit();
} else {
echo("<p>Successfully Connected to Database 'MYSQL'!</p>");
}
?>
---------------------------------------------------------------------
Whenever I try to open the file (testmysql.php) in IE or Firefox I get a blank screen. I tried opening my phpinfo.php script which returns my PHP info as expected but whenever I run the above script I get a blank screen.
Does anyone have any idea what coudl be wrong? The script looks fine to me, the server name, usernam, and password are definately correct.
Any help is much appreciated guys....I have barely spoken to my wife in three days trying to get this done...Not sure how long she is going to let me away with it
Re: Can't Install PHP in Windows XP
Turn on error reporting in php.ini?
Re: Can't Install PHP in Windows XP
Thanks jackpf....
I configured php.ini to: display_error = On
Unfortunately I still get a blank screen!
As far as I can see php is installed and workign fine, IIS is installed and working fine, mysql is installed and working fine....The problem I guess is connecting to my database. Is there anythign I need to configure in mysql?
Thanks again everyone for your help with this.
John.
I configured php.ini to: display_error = On
Unfortunately I still get a blank screen!
As far as I can see php is installed and workign fine, IIS is installed and working fine, mysql is installed and working fine....The problem I guess is connecting to my database. Is there anythign I need to configure in mysql?
Thanks again everyone for your help with this.
John.
Re: Can't Install PHP in Windows XP
Did you restart apache?
If there's an error connecting to the database, you should see...well, an error.
Try puttingat the top of the script.
EDIT
Thinking about it, I think it should be "E_ALL" (no quotes) rather than "On" in php.ini.
If there's an error connecting to the database, you should see...well, an error.
Try putting
Code: Select all
error_reporting(E_ALL);EDIT
Thinking about it, I think it should be "E_ALL" (no quotes) rather than "On" in php.ini.
Re: Can't Install PHP in Windows XP
WOOOO HOOOOO!
I can't believe it, I eventually have it working.....The problem was as follows:
Initially I had to rename the "php.ini-recommended" file to "php.ini" and save it in the Windows folder. However, I noticed that although I did this, I also had a php.ini file still resident in the C:/php directory. I deleted the php.ini file from the C:/php directory and everything now works absolutely perfectly!
Thanks a lot for your help guys....I'm sure I will be coming back here often and maybe even returning the favour one day!
I can't believe it, I eventually have it working.....The problem was as follows:
Initially I had to rename the "php.ini-recommended" file to "php.ini" and save it in the Windows folder. However, I noticed that although I did this, I also had a php.ini file still resident in the C:/php directory. I deleted the php.ini file from the C:/php directory and everything now works absolutely perfectly!
Thanks a lot for your help guys....I'm sure I will be coming back here often and maybe even returning the favour one day!