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?
run php script in web browser
Moderator: General Moderators
Re: run php script in web browser
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?
What server? Yours? One you've set up on your own computer?
Re: run php script in web browser
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 scripttasairis 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?
Re: run php script in web browser
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?
If you have a file called phpinfo.php containing only
Code: Select all
<?php phpinfo();Re: run php script in web browser
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 onlycan you get to that page? Do you see a lot of configuration information?Code: Select all
<?php phpinfo();
Yes it works since it is not in the folder holding my website details
Re: run php script in web browser
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
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.
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.