Page 1 of 1
run php script in web browser
Posted: Wed Jul 29, 2009 11:47 pm
by lordrt
Hi all
Am trying to run a php script from a server on my browser but am only getting the download option for the script.
e.g.
http://www.example.com/path/script/is/stored/scr.php
can a php script be really run in any browser?
Re: run php script in web browser
Posted: Thu Jul 30, 2009 12:18 am
by requinix
It doesn't run on a browser. It runs on the server. Meaning the server has to know how to run PHP files.
What server? Yours? One you've set up on your own computer?
Re: run php script in web browser
Posted: Thu Jul 30, 2009 1:13 am
by lordrt
tasairis wrote:It doesn't run on a browser. It runs on the server. Meaning the server has to know how to run PHP files.
What server? Yours? One you've set up on your own computer?
Actually found out that there is url rewriting being done by apache, and therefore was treating the php script as a normal file, that is processing index.php first and then locating the php script
Re: run php script in web browser
Posted: Thu Jul 30, 2009 2:47 am
by requinix
Unless the rewriting does something unusual, as long as the final post-rewriting filename is a PHP file then that PHP file will execute.
If you have a file called phpinfo.php containing only
can you get to that page? Do you see a lot of configuration information?
Re: run php script in web browser
Posted: Thu Jul 30, 2009 3:29 am
by lordrt
tasairis wrote:Unless the rewriting does something unusual, as long as the final post-rewriting filename is a PHP file then that PHP file will execute.
If you have a file called phpinfo.php containing only
can you get to that page? Do you see a lot of configuration information?
Yes it works since it is not in the folder holding my website details
Re: run php script in web browser
Posted: Fri Jul 31, 2009 7:37 am
by parabo
i am also facing the same problem. my php script doesn't run on my browser(internet explorer) yet i installed iis and wamp server with php5.1. iis works but php scripts dont show anything. i also have to create a database connection between my php application and mysql server. how can i do this when my browser cant even show me the script? help me please!
Re: run php script in web browser
Posted: Fri Jul 31, 2009 7:40 am
by jackpf
Browsers don't run php scripts, that's already been expressed.
Are you opening a connection to your local pc or are you trying to run scripts directly from the browser? If the latter, do the former instead.