Link to home
Start Free TrialLog in
Avatar of JPERKS1985
JPERKS1985

asked on

Installing php on fedora 6

I just installed Fedora 6 and I need to know how to install php. I was able to install apache when I did the OS install and when I go to ad/remove programs php has checkmarks next to them so I believe their installed. But there is no php testpage i can view. How do I get this working?
ASKER CERTIFIED SOLUTION
Avatar of ygoutham
ygoutham
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JPERKS1985
JPERKS1985

ASKER

what should i check?
also i put a testpage in the html folder nad it just comes up blank
if you write a simple php script to echo 'hello world'; kind of script and run a commandline text like

php /your/script.php

does the script work properly???

if so, then the php.conf in httpd should point to a libphp5.so in /etc/http/modules directory.

mine has the following lines

################

LoadModule php5_module modules/libphp5.so
AddType text/html .php
DirectoryIndex index.php
###########



or else you can try a

rpm -e php (or remove php-mysql first and then this package and)

do a

yum install php
if you do a rpm -q php do you get php5.1.6...???
yes i do

[root@localhost ~]# rpm -q php
php-5.1.6-3.1.fc6
when i do yum heres what it shows,


[root@localhost ~]# yum install php
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@localhost ~]#

heres my conf.d


#
# 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
what about

php test.php

????
if the script executes fine then we know that php is not the culprit and we need to look at your httpd.conf and other details.  but if php itself is a problem, then we need to ensure that the installation did not ahve any trouble when it installed.  you can get output of php files through a command line execution "php /my/script.php" and therefore the question.
[root@localhost ~]# php test.php
Could not open input file: test.php
[root@localhost ~]#

Perhas theres another location to put my php files?
i suggested "yum install" after removal of php. it seems that your rpm -q is giving yum a reply for the question of php installation and version number.  do the above and then if it is not working i would suggest removal and reinstallation of php all over again. NOT otherwise.
[root@localhost ~]# rpm -e php
error: Failed dependencies:
        php = 5.1.6-3.1.fc6 is needed by (installed) php-ldap-5.1.6-3.1.fc6.i386
        php = 5.1.6-3.1.fc6 is needed by (installed) php-pdo-5.1.6-3.1.fc6.i386
        php = 5.1.6-3.1.fc6 is needed by (installed) php-mysql-5.1.6-3.1.fc6.i386
        php = 5.1.6-3.1.fc6 is needed by (installed) php-odbc-5.1.6-3.1.fc6.i386
        php >= 5.0.6 is needed by (installed) phpldapadmin-1.0.1-1.fc6.noarch
[root@localhost ~]#



write a file called test.php and here are the contents

############

<?php

echo "Hello User!!!!";

?>

##################

then do a php test.php in the same directory as where you have written the file.  it should run from anywhere.

ideally php executable is in /usr/bin/php  (is the file there????)
[root@localhost ~]# cd /
[root@localhost /]# dir
bin   dev  home  lost+found  misc  net  proc  sbin     srv  test.php   tmp  var
boot  etc  lib   media       mnt   opt  root  selinux  sys  test.php~  usr
[root@localhost /]# php test.php
Hello User!!!![root@localhost /]#

i think theres an issue integrating apache w/ the php, because the php is definately installed.
do NOT remove before you confirm that php is not working.  once we know firmly then we can go one by one and do

rpm -e php-mysql
rpm -e php-odbc
.
.
.
rpm -e php

and when it is all done,

yum install php
did you see my reponse?
php is definately installed but i don't think its configured correctly.
first do the following.

1.  check for the file libphp5.so (whatever, the php.conf says) in /etc/httpd/modules directory.
2.  copy the same "test.php" to /var/www/html and try opening "http://localhost/test.php"  (do you see hello world!!!!!)
3.  try adding one more line to test.php "phpinfo();".  This should give a load of info on what php version, etc on the browser window.
4.  i see that if i name my files "*.html" and include some php inside then it also gives me weird output. does the same happen with you as well???
lilphp5.so exists in moduldes folder
when i copy test to that folder ti comes up blank in the browser


when I rename the test.php to test.html i get


Forbidden

You don't have permission to access /test.html on this server.

This may be a clue of some sort.
figured it out, php is working now it was a permissions issue thanks for the help.