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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting php to work on fedora2

Status
Not open for further replies.

biscuitboy

Technical User
Dec 11, 2004
22
0
0
GB
Hi,

Im a first time user of linux and have just installed Fedora2. What I want to be able to do is design a html document with php contected to a mysql database. The problem I have is that when I try even the most simple strings of code for php like:

<?php
print ("test");
?>

when I run it trough the internet explorer It comes up with a blank screen.

Is this because php isnt installed or do I need to change a setting? I have been to the php.net website and it states that php is normally bundled with linux.

Any help would be much appreciated

Regards

 
PHP is bundled with FC2. I don't know, however, whether it is installed by default. If you do

rpm -qa | grep -i php

what is returned?

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
You need to verify that Apache (httpd) is installed and configured to use PHP (assuming PHP is installed). The httpd.conf file needs to be edited to tell the webserver to use PHP and that PHP extensions are valid.

The edits will look something like this:

#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

Did you install Apache and PHP as part of your installation or after the installation?

MikeS



Find me at
&quot;Take advantage of the enemy's unreadiness, make your way by unexpected routes, and attack unguarded spots.&quot;
Sun Tzu
 
The apache was installed after the installation of fedora. As for the php there were no options to install it so im only guessing it might of been installed automatically.

Can I make the changes to the httpd.conf file like you said anywherew in the document or does it have to go in a particular place?

Regards
 

when I type in "rpm -qa | grep -i php"

I get:

php-pgsql-4.3.4-11
php-4.3.4-11
php-mysql-4.3.4-11
php-pear-4.3.4-11
php-ldap-4.3.4-11
php-odbc-4.3.4-11

so im guessing php is installed. Just need to get it configured now

regards

 
Next question, did you install Apache from a tarball or from an RPM? If an RPM, I would erase the files (rpm -e ) and then reinstall it using a tarball and then compile it (./configure) with the correct parameters that tell Apache that it needs to use PHP. In fact, if it were myself (and it has been) I would remove PHP also and then do Apache first, then PHP both from tarballs. See this link for building a LAMP server (or buy my book since I go over this in detail[wink])

Or use Bruce's directions which are very good.


MikeS


Find me at
&quot;Take advantage of the enemy's unreadiness, make your way by unexpected routes, and attack unguarded spots.&quot;
Sun Tzu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top