English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can anyone tell me why its doing this ? I am trying to get the PHP code to execute but all i get is the code itself opening up in kedit when i type the path into firefox.....any help ?? The file is in /usr/share/... directory

2006-10-12 23:24:56 · 2 answers · asked by Lukas D 3 in Computers & Internet Programming & Design

2 answers

Yes, I faced this problem when I started coding PHP. Add this line to your httpd.conf file:
AddType application/x-httpd-php .php .phtml
This will ensure that all files ending in .php or .phtml will be parsed as PHP. By all means add more extensions!
Once you have done this, you will need to restart your Apache Webserver.

Good luck!

2006-10-13 12:44:23 · answer #1 · answered by Stewie Griffin 2 · 0 0

PHP scripts have to be run from the web server. If you open the file its self you get the result you have. Move the file to the DocumentRoot of your web server then open it with http://localhost/path/to/file and you should get the result you are looking for.
PHP is a server side scripting language and needs to be run by Apache.

2006-10-12 23:36:26 · answer #2 · answered by John K 4 · 0 0

fedest.com, questions and answers