Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Installing php on fedora 6

Posted on 2006-11-10
22
Medium Priority
?
454 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 13
  • 9
22 Comments
 
LVL 14

Accepted Solution

by:
ygoutham earned 2000 total points
ID: 17920029
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
ID: 17920037
what should i check?
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17920038
also i put a testpage in the html folder nad it just comes up blank
0
Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

 
LVL 14

Expert Comment

by:ygoutham
ID: 17920073
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
ID: 17920099
if you do a rpm -q php do you get php5.1.6...???
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17920155
yes i do

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

Author Comment

by:JPERKS1985
ID: 17920157
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
ID: 17920161
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
ID: 17920170
what about

php test.php

????
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 17920172
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
ID: 17920173
[root@localhost ~]# php test.php
Could not open input file: test.php
[root@localhost ~]#

Perhas theres another location to put my php files?
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 17920175
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
ID: 17920180
[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
ID: 17920185
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
ID: 17920195
[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
ID: 17920199
i think theres an issue integrating apache w/ the php, because the php is definately installed.
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 17920202
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
ID: 17920206
did you see my reponse?
0
 
LVL 1

Author Comment

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

Expert Comment

by:ygoutham
ID: 17920219
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
ID: 17921967
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
ID: 17922190
figured it out, php is working now it was a permissions issue thanks for the help.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

718 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