george_a_lutz asked:
I’m running on linux. My index.php is in /var/www/html which works because i can view it from a client browser, however it only displays stuff as html, not as php.
I’m running on linux. My index.php is in /var/www/html which works because i can view it from a client browser, however it only displays stuff as html, not as php.
I’ve never used php before today so i may be missing something obvious. I assumed that the server should just execute the php. Seems like it’s not though. Any ideas?
Thanks!


3 Comments to 'How can I execute a php script on a server?'
March 16, 2010
You need to configure the server to run the PHP. This requires installing PHP on the server and configuring the webserver to use PHP.
March 18, 2010
PHP doesn’t “display as PHP”, it creates HTML for the browser to render. What the browser displays should be a plain old web page. (You need to understand what PHP is, how it’s used, and what it does - and doesn’t do.)
March 20, 2010
It sounds like your web server is not configured to serve PHP. The steps required vary depending on the server you’re using, of course. Check out. They do a pretty good job documenting the steps you need to follow to set up PHP for your operating system and web server.
Another option you may want to check out is WAMP (http://www.wampserver.com/en/) if you’re using Winows (Google for LAMP if you’re using Linux). That will give you an installer for Apache, PHP and MySQL pre-configured to work together; it’s often the easiest way to get a basic environment set up.
Hope this helps, and good luck!
Leave a comment