Help - screen is displaying source code
Moderator: General Moderators
-
dangerousjohnny
- Forum Newbie
- Posts: 8
- Joined: Thu Nov 13, 2003 12:05 pm
Help - screen is displaying source code
Hi everyone,
I am fairly new to PHP, but I recently installed Apache and PHP and everything was working fine, but all of a sudden, when I run my perl scripts, the browser just displays the source code. These same scripts worked fine the other day, but now nothing works. help!
I am fairly new to PHP, but I recently installed Apache and PHP and everything was working fine, but all of a sudden, when I run my perl scripts, the browser just displays the source code. These same scripts worked fine the other day, but now nothing works. help!
Last edited by dangerousjohnny on Thu Nov 13, 2003 12:40 pm, edited 1 time in total.
-
Cruzado_Mainfrm
- Forum Contributor
- Posts: 346
- Joined: Sun Jun 15, 2003 11:22 pm
- Location: Miami, FL
i don't think he needs to post source code, i think he has somehow misconfigured apache in the httpd.conf file, check that file and look where there php interpreter is aliased, maybe you changed php.exe to another folder, check that too
hope this helps
ps. this is a PHP Code forum, this post should be moved to the General forum
hope this helps
ps. this is a PHP Code forum, this post should be moved to the General forum
-
dangerousjohnny
- Forum Newbie
- Posts: 8
- Joined: Thu Nov 13, 2003 12:05 pm
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
Ok, now open the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf and look for these lines:
Where is your PHP installed to? It must be C:\php\
Code: Select all
ScriptAlias /php/ "c:/php/"
Action application/x-httpd-php "/php/php.exe"
AddType application/x-httpd-php .php-
dangerousjohnny
- Forum Newbie
- Posts: 8
- Joined: Thu Nov 13, 2003 12:05 pm
Yes I have all of that in my httpd.conf and php is installed in c:\php\scorphus wrote:Ok, now open the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf and look for these lines:Where is your PHP installed to? It must be C:\php\Code: Select all
ScriptAlias /php/ "c:/php/" Action application/x-httpd-php "/php/php.exe" AddType application/x-httpd-php .php
I don't know why, it worked last week.
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
Are you sure about the file extensions? Create a new file inside C:\Program Files\Apache Group\Apache2\htdocs, name it test.php and write this:
to it. Point your browser to http://localhost/test.php. What you get?
Code: Select all
<?php
phpinfo();
?>-
dangerousjohnny
- Forum Newbie
- Posts: 8
- Joined: Thu Nov 13, 2003 12:05 pm
Hey, that worked! Maybe it was because I was using my browser then file->open and selecting the files that it wasn't working.scorphus wrote:Are you sure about the file extensions? Create a new file inside C:\Program Files\Apache Group\Apache2\htdocs, name it test.php and write this:to it. Point your browser to http://localhost/test.php. What you get?Code: Select all
<?php phpinfo(); ?>
Thank you very much!
-
Paddy
- Forum Contributor
- Posts: 244
- Joined: Wed Jun 11, 2003 8:16 pm
- Location: Hobart, Tas, Aussie
- Contact:
That is exactly why it wasn't working, not maybe. 
With an html file you can just open it locally via the browser. With a php file you need to have php installed and then open it with a http address.
And just for you info. If you want an external computer to look at your php stuff you can swap "localhost" with your IP address. Not part of your problem but if you are new to this you may wanna know that.
With an html file you can just open it locally via the browser. With a php file you need to have php installed and then open it with a http address.
And just for you info. If you want an external computer to look at your php stuff you can swap "localhost" with your IP address. Not part of your problem but if you are new to this you may wanna know that.
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
You're welcome, I'm glad it works! Remeber all PHP execution is made by the webserver. So to see how your PHP pages are 'running' you have to request them from the webserver (Apache via HTTP, http://localhost in your case) not to the file-system (Windows' file-system via file->open). Do this last when going to edit them...
Well, it's all nice now
have fun!
Regards,
Scorphus.
Well, it's all nice now
Regards,
Scorphus.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK