Apache2 displaying PHP5 source code

Reply

Join Date: Jun 2005
Posts: 4
Reputation: demetri007 is an unknown quantity at this point 
Solved Threads: 0
demetri007 demetri007 is offline Offline
Newbie Poster

Apache2 displaying PHP5 source code

 
0
  #1
Jun 18th, 2005
I installed Apache2, PHP5, openssl, Mysql4.1 all from src(except MySql=>RPM). The problem I am having is with PHP ( well I think anyway ). When I start Apache it loads php without error, but when I point Firefox to localhost/test.php which contains

CODE:
<?php phpinfo(); ?>

,its displayed rather than executed.

Any Ideas, been beating my head for a two days with this. I am able to connect to mysql with out a problem also.

Thanks Demetri
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 35
Reputation: comprookie2000 is an unknown quantity at this point 
Solved Threads: 3
comprookie2000's Avatar
comprookie2000 comprookie2000 is offline Offline
Light Poster

Re: Apache2 displaying PHP5 source code

 
0
  #2
Jun 18th, 2005
What disto? You will need to add
  1. APACHE2_OPTS="-D SSL -D PHP5"
to your apache2 conf. file.It is located in different places in different distro's.The above is for php and ssl support,that loads the modules when apache2 starts.
Reply With Quote Quick reply to this message  
Join Date: Nov 2003
Posts: 781
Reputation: Zachery has a spectacular aura about Zachery has a spectacular aura about 
Solved Threads: 21
Team Colleague
Zachery's Avatar
Zachery Zachery is offline Offline
The Geek Father

Re: Apache2 displaying PHP5 source code

 
0
  #3
Jun 18th, 2005
Did you add the .php extension and the php module into apaches config file
Firefox: no, its not the end all solution, it has its own issues and in time it will be just as insecure as IE, when its hit Firefox 6, if it makes it that far. Oh, and AOL pays for it, incase you didn't know.

Microsoft & Windows: If you hate it so much, move to linux, or bsd, or anything else, stop complaning and move on.
Good starting places: Gentoo Novell SUSE Fedora Core Apple
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 4
Reputation: demetri007 is an unknown quantity at this point 
Solved Threads: 0
demetri007 demetri007 is offline Offline
Newbie Poster

Re: Apache2 displaying PHP5 source code

 
0
  #4
Jun 18th, 2005
Originally Posted by comprookie2000
What disto? You will need to add
  1. APACHE2_OPTS="-D SSL -D PHP5"
to your apache2 conf. file.It is located in different places in different distro's.The above is for php and ssl support,that loads the modules when apache2 starts.

Shoot, I am sorry. I am running Suse 9.1. Also I tried the code above and when started Apache with error. Something like "error on line #### misspelled or enabled in a module". Apache was installed /usr/local/apache2, php5 /usr/local/php5, and openssl /usr/local/lib. If this helps, when I point firefox to an url that does not exist I get the apache file not found error. The last line states "apache 2 mod_ssl openssl php5" thats not word for word. The MySql installation was done with the seperate RPM packages from mysql.com.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 4
Reputation: demetri007 is an unknown quantity at this point 
Solved Threads: 0
demetri007 demetri007 is offline Offline
Newbie Poster

Re: Apache2 displaying PHP5 source code

 
0
  #5
Jun 19th, 2005
Originally Posted by Zachery
Did you add the .php extension and the php module into apaches config file

Yup did that. When I point firefox to http://localhost/phpinfo.php I am asked if i would like to download the file instead.

Dont get it LOLOL, must be something I am overlooking.

Thanks
Demetri
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 4
Reputation: demetri007 is an unknown quantity at this point 
Solved Threads: 0
demetri007 demetri007 is offline Offline
Newbie Poster

Re: Apache2 displaying PHP5 source code

 
0
  #6
Jun 19th, 2005
OK got it working. I had placed the AddType... statement at the wrong location. To correct the error, I placed it at the last line of the httpd.config file. All is well now.

Thanks for the help
Demetri
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC