Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to PHP 1

Status
Not open for further replies.

Rene1024

MIS
Jul 24, 2003
142
US
Hello,

I just started playin around with PHP.

I've installed FC4, Apache2, mysql, and PHP5; however, all the files with a .php extension open up with the text editor.

I already made changes to the apache conf file and inserted the appropiate AddType lines?

What am I missing?

Rgds.

Rene
 
What problems are you having? What error messages are you receiving?

Lee
 
if the files open up in a text editor I guess you are double clicking them?

.php files should be located in /var/ or a subdir from this location eg /var/
point a web browser at and it should be presented just fine provided apache is actually running.

One thing to note, on FC4 the /etc/php.ini has DisplayErrors = Off

If you are new to php, I would suggest changing this to On and restarting apache.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Thanks for your replies,

I did what KarverR suggested, I made the changes to the php.ini files, re-started apache and then used my firefox browser to open my hello.php file licated in /var/ folder and I still can't see the files on my browser. I get a window asking me if I want to open the file with Firefox and when I select "yes" the same windows opens up again over and over.

This is the actual message:

You have chosen to open:

Hello.php

which is a PHP script

from /var/
What should Firefox do with this file?

The options are Open or Save to disk, but if I select open, the same window keeps popping up.

Rgds.

Rene
 
all the settings are right in /etc/httpd/conf.d/php.conf ?

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
This is what the file looks like:

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_module modules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
AddType application/x-httpd-php-source .phps

Is this OK?

Rgds.
Rene
 
I re-read your first post, should have noticed, I dont think you need the AddType lines in the httpd.conf any more, apache 2 and php5 do it a little differently to apache and php4.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Thanks for all your help KarveR.

I commented out the AddType lines that you suggest and it stated working.

Take Care.

Rene

 
Hope you enjoy PHP Rene :)

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
If your using Fedora a nice easy way to get the whole lot installed and running (with a basic config that works) is getting on via ssh/console and typing the following;

yum -y install httpd php mysql mysql-server php-mysql

That will dump the whole lot on and configure it. If you havn't set yum up then have a look at
I wish someone would just call me Sir, without adding 'Your making a scene'.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top