wallpapersafe PHP Problem: I See Code Only Shows Script Code Not Working Instead of Pagewallpapersafe - PHP Problem: I See Code Only - Shows Script Code Not Working Instead of Page
PHP Problem: I See Code Only - Shows Script Code Not Working Instead of Page - This page contains information about PHP Problem: I See Code Only - Shows Script Code Not Working Instead of Page Here you can also give your thought about the subject of PHP Problem: I See Code Only - Shows Script Code Not Working Instead of Page
Sat February 4, 2012, 6:46 am
|
|
|
PHP Problem: I See Code Only - Shows Script Code Not Working Instead of Page |
|
I just configured a new server Linux Apache Server with PHP. But for some reason my php scripts are not working. instead of showing the html pages, it shows the PHP script code. If you are having the same problem, this is how I was able to fix my problem. 1. reboot server - Try again. if you are still getting same results, go to step 2. 2. make sure you have PHP installed. Click here to learn how to check if PHP is installed. 3. If PHP is installed in your server, then the last step (that I know of) is to check the PHP configuration file. My my example, This will work for REDHAT and FEDORA distributions. Follow these steps: - Login to your shell are ROOT or SU (Super User) if you don't know how to do this, i suggest you stop here, otherwise continue.
- Make a back up file of /etc/httpd/conf.d/php.conf
- execute the following command: nano /etc/httpd/conf.d/php.conf
- you will see the php.conf file. make sure that the following two lines are not comment out (meaning, they dont have a # at the bigenning of the line) you will find it in the 10 and 11 line or somewhere near these lines.
- AddHandler php5-script .php
- AddType text/html .php
- If either or both of the lines on step 5 and/or 6 are commented, remove the pound sign ( # ) and hit control + x
- The system will ask you if you want to save changes. type the letter y and then hit return.
- then it will ask you to save the file as php.conf. Hit return to acknoledge.
- Reboot apache by executing the following command:
- /etc/init.d/httpd restart
- at this time, you should see your apache server stop and then start again. if it fails, you didnot follow the steps correctly. at this point you can always go back to you original configuration with the pho.conf back up file you saved. If you see OK, go to the next step
- Now go to your site again, and hopefuly you wont see your php code, but instead you will see your page. If you are still getting the PHP code, then I dont know what else it could be.
Hope this has help you. if it did, i would ask that you give credit to wallpaperama.com
Thanks Admin |
|
|
|
|
|