[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 458
  • Last Modified:

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?
0
JPERKS1985
Asked:
JPERKS1985
  • 13
  • 9
1 Solution
 
ygouthamCommented:
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
 
JPERKS1985Author Commented:
what should i check?
0
 
JPERKS1985Author Commented:
also i put a testpage in the html folder nad it just comes up blank
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ygouthamCommented:
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
 
ygouthamCommented:
if you do a rpm -q php do you get php5.1.6...???
0
 
JPERKS1985Author Commented:
yes i do

[root@localhost ~]# rpm -q php
php-5.1.6-3.1.fc6
0
 
JPERKS1985Author Commented:
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
 
JPERKS1985Author Commented:
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
 
ygouthamCommented:
what about

php test.php

????
0
 
ygouthamCommented:
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
 
JPERKS1985Author Commented:
[root@localhost ~]# php test.php
Could not open input file: test.php
[root@localhost ~]#

Perhas theres another location to put my php files?
0
 
ygouthamCommented:
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
 
JPERKS1985Author Commented:
[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
 
ygouthamCommented:
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
 
JPERKS1985Author Commented:
[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
 
JPERKS1985Author Commented:
i think theres an issue integrating apache w/ the php, because the php is definately installed.
0
 
ygouthamCommented:
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
 
JPERKS1985Author Commented:
did you see my reponse?
0
 
JPERKS1985Author Commented:
php is definately installed but i don't think its configured correctly.
0
 
ygouthamCommented:
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
 
JPERKS1985Author Commented:
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
 
JPERKS1985Author Commented:
figured it out, php is working now it was a permissions issue thanks for the help.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 13
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now