Solved

Installing php on fedora 6

Posted on 2006-11-10
22
446 Views
Last Modified: 2013-12-06
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?
0
Comment
Question by:JPERKS1985
  • 13
  • 9
22 Comments
 
LVL 14

Accepted Solution

by:
ygoutham earned 500 total points
Comment Utility
did you check on the

/etc/httpd/conf.d/php.conf

i have a similar setup over here and php installed by default and working fine.
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
what should i check?
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
also i put a testpage in the html folder nad it just comes up blank
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
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
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
if you do a rpm -q php do you get php5.1.6...???
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
yes i do

[root@localhost ~]# rpm -q php
php-5.1.6-3.1.fc6
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
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 ~]#

0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
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
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
what about

php test.php

????
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
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.
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
[root@localhost ~]# php test.php
Could not open input file: test.php
[root@localhost ~]#

Perhas theres another location to put my php files?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
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.
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
[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 ~]#



0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
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????)
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
[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 /]#

0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
i think theres an issue integrating apache w/ the php, because the php is definately installed.
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
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
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
did you see my reponse?
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
php is definately installed but i don't think its configured correctly.
0
 
LVL 14

Expert Comment

by:ygoutham
Comment Utility
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???
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
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.
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
figured it out, php is working now it was a permissions issue thanks for the help.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now