...

View Full Version : Loading php pages



onet0o
03-02-2007, 06:32 AM
Hello I am new to the forum and I am having issues loading php pages. I installed apache and php. At first when I would complete a php code and place it in my document root folder, it would open on my browser no problem. But lately when I try to open it on my browser, I always get the option to either open with a program or save it. So now I cannot view my php pages on my browser. Has anyone experienced a problem like this? Thank you very much for your help in advance.

zHeN
03-02-2007, 06:36 AM
Hmm... Did you open your apache? Cos u need to start your apache first before u can view it.

chump2877
03-02-2007, 06:49 AM
Are you using a MS Windows OS? If so, perhaps, you need to go into Windows Explorer, select Folder Options under Tools, then the File Types tab, and choose a program (i.e., a browser) to associate with all files with the .php file extension....just a guess

Inigoesdr
03-02-2007, 08:27 PM
Are you using a MS Windows OS? If so, perhaps, you need to go into Windows Explorer, select Folder Options under Tools, then the File Types tab, and choose a program (i.e., a browser) to associate with all files with the .php file extension....just a guess

No, the problem is server-side. You don't have the web server setup correctly to handle php files.
Or it might not even be started like zHen said.

onet0o
03-02-2007, 11:31 PM
hmm... I double checked to make sure apache was started and it was. It worked fine before but recently it has been funny. I set up all the files like I read, and it worked normally before so I'm not sure what the issue is.

Inigoesdr
03-03-2007, 03:29 AM
Check the httpd.conf and make sure PHP is setup.

rafiki
03-03-2007, 12:07 PM
hes not looking at the page properly, make sure u got http://localhost/folder/pagename.php or http://yourip/folder/pagename.php

Inigoesdr
03-03-2007, 05:16 PM
That's not the problem:

...it would open on my browser no problem. But lately when I try to open it on my browser ...
onet0o should know how to do that if it used to work.

ess
03-03-2007, 10:19 PM
I am not sure 100%, but this could be due to apache not understanding what to do with PHP files. In other words, Apache should let PHP engine handle the file processing, but instead of doing that, it just uploads the file contents and hence you are getting save or download file...etc

Check your httpd.config, and make sure that the following line exist

AddType application/x-httpd-php .php

You should also make sure that the PHP module is loaded. Check if the following line exist, and whether it points to the correct path to where you have installed PHP or not.

LoadModule php5_module "c:/php/php5apache.dll"

I would also recommend using WAMP (http://www.wampserver.com/en/)if you are using windows. It will install PHP, MySQL, SQLite, PhpMyAdmin, Apache2, SQLite Admin using a single installer. Plus, you can install PHP4 Addon so that you can switch between PHP4 and PHP5 when necessary.

Cheers,
Ess

onet0o
03-04-2007, 07:04 AM
I am not sure 100%, but this could be due to apache not understanding what to do with PHP files. In other words, Apache should let PHP engine handle the file processing, but instead of doing that, it just uploads the file contents and hence you are getting save or download file...etc

Check your httpd.config, and make sure that the following line exist


You should also make sure that the PHP module is loaded. Check if the following line exist, and whether it points to the correct path to where you have installed PHP or not.


I would also recommend using WAMP (http://www.wampserver.com/en/)if you are using windows. It will install PHP, MySQL, SQLite, PhpMyAdmin, Apache2, SQLite Admin using a single installer. Plus, you can install PHP4 Addon so that you can switch between PHP4 and PHP5 when necessary.

Cheers,
Ess

Hmm.. I have all of that in my httpd.conf file.

Maybe AddType application/x-httpd-php .php line is not in the correct place? In the AddType lines does that line go at the end after AddType application/x-gzip .gz .tgz?

Thanks to everyone for the help. I really appreciate it.

Inigoesdr
03-04-2007, 05:02 PM
Yeah, they should be fine there. Check your logs for any errors from apache/php.

onet0o
03-04-2007, 05:29 PM
I'm still very new at this, how do you check you logs?

Inigoesdr
03-04-2007, 05:33 PM
Look for a "logs" folder in the apache folder, and specifically the error_log in that folder.

onet0o
03-04-2007, 08:42 PM
cool, thanks.

Also if I use WAMP, do I have to re configure Apache, Mysql and PHP all over again? Or does it do that automatically?

Inigoesdr
03-04-2007, 09:00 PM
Probably does most if not all of it automatically, but you might want to remove your current setup first to avoid confusion and conflicts between the two.

CFMaBiSmAd
03-04-2007, 09:25 PM
If you are going to re-install/install an all in one package, it may solve your problem, but in case it does not or you keep trying with your current setup, have you tried to browse to a .htm or .html file and are the symptoms the same? The symptom of presenting the open/save as dialog is typically because the content type header is not present or wrong and the browser is dealing with the content in the best way that it knows how.

Did a browser security update get applied or any other update? Have you tried this with a different browser?

This could be anything from the web server, php installation, lmhosts file, anti-virus software, firewall, network setting, permissions, virus...

onet0o
03-05-2007, 02:43 AM
Thanks everyone for the help
I reinstalled everything with WAMP and things seem to be fine now.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum