why does the index.php file display the code?
Moderator: General Moderators
why does the index.php file display the code?
:cry: I have installed PHP and can see the phpinfo(), but when I try to view my development website all i see is the code in the index.php.
My virtual host is setup correctly, mysql is running and also Apache. I have this added AddType application/x-httpd-php .php in the http.conf file.
I am really lost with this one
My virtual host is setup correctly, mysql is running and also Apache. I have this added AddType application/x-httpd-php .php in the http.conf file.
I am really lost with this one
- Wayne Herbert
- Forum Commoner
- Posts: 34
- Joined: Tue Apr 29, 2003 3:13 pm
- Location: Houston, Texas
and check wether the index.php script uses short tags <? ... ?>
They might be disabled.
http://www.php.net/manual/en/configurat ... t-open-tag
They might be disabled.
http://www.php.net/manual/en/configurat ... t-open-tag
the code is:
<?php header("Location: http://fletcher.co.uk/site/site.php/hom ... newsession"); ?>
Calling the script using http://www.fletcher.co.uk
Volka as you can see the index.php uses <? ?>, i have checked and it is on.
<?php header("Location: http://fletcher.co.uk/site/site.php/hom ... newsession"); ?>
Calling the script using http://www.fletcher.co.uk
Volka as you can see the index.php uses <? ?>, i have checked and it is on.
Last edited by adneg on Thu May 22, 2003 11:28 am, edited 1 time in total.
"index.osp"? did you configure apache so that it would execute .osp files?<?php header("Location: http://fletcher.co.uk/site/site.php/hom ... newsession"); ?>
did you use the .osp file extension on purpose? why not just use index.php instead of index.osp?
<?php header("Location: http://fletcher.co.uk/site/site.php/hom ... newsession"); ?>
This told apache that files with the extension .php are of the mimetype application/x-httpd-php (that is handled by the php module).I have this added AddType application/x-httpd-php .php in the http.conf file.
Now you want to tell apache that files with the extension .osp are of the same mimetype...
(there's no way of asking the designer "why .osp?" ?)
http://httpd.apache.org/docs-2.0/mod/mo ... ml#addtype
you don't want to tell apache the files are of the mimetype application/x-httpd-osp because mod_php doesn't handle it.
But it handles application/x-httpd-php for as many extensions as you like
mod_php registered itself as handler for application/x-httpd-php
But it handles application/x-httpd-php for as many extensions as you like
this tells apache that whenever it hits a file with the extension extension it should treat the file as mimetype MIME-type. So it will search for a handler that will serve MIME-type.AddType MIME-type extension [extension] ...
mod_php registered itself as handler for application/x-httpd-php
only replace in your httpd.conf
byAddType application/x-httpd-php .php
Code: Select all
AddType application/x-httpd-php .php .ospCreate test.osp, and fill it with
And call that script directly from a browser. Post the output here.
Code: Select all
<?php
$foo = "bar";
echo $foo;
?>And call that script directly from a browser. Post the output here.