LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
LinkBack Search this Thread
Old 11-16-2005, 09:32 PM   #1
arichardson
LQ Newbie
 
Registered: Nov 2005
Posts: 25

Rep: Reputation: 15
php will NOT work correctly :(


I have been trying to get php to work with apache 2 for quite some time. I've installed from source and used the default install on Fedora as well. I've scoured php.net and read all I could find in the docs.

I get a blank screen when I try to access a .php file. Below is part of my apache config file showing the only places relavent to php (to my knowlege)

Hopefully, someone can help

LoadModule php4_module modules/libphp4.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule auth_ldap_module modules/mod_auth_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

AddHandler imap-file map
AddHandler type-map var

AddType application/x-x509-ca-cert .crt
AddOutputFilter INCLUDES .shtml
 
Old 11-16-2005, 11:03 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043

Rep: Reputation: 83
PHP

Add this to the end of your LoadModules depending on Your php version.
LoadModule php4_module libexec/libphp4.so
or
LoadModule php5_module libexec/libphp5.so

Then restart apache and you should then be working.

<html>
<head><title>Show PHP Information</title></head>
<body>
<?phpinfo()?>
</body>
</html>

this small script should show you all the php information. Hope this helps.

Last edited by jstephens84; 11-16-2005 at 11:05 PM.
 
Old 11-17-2005, 07:17 AM   #3
arichardson
LQ Newbie
 
Registered: Nov 2005
Posts: 25

Original Poster
Rep: Reputation: 15
That's the very first line of my LoadModules section. Does it need to be last?
 
Old 11-17-2005, 07:22 AM   #4
arichardson
LQ Newbie
 
Registered: Nov 2005
Posts: 25

Original Poster
Rep: Reputation: 15
Well, I figured out what it was...
I was using the wrong syntax in my php script. I had a space between the '?' and 'php' when there isn't supposed to be.

Dang, all that time over one silly character lol
 
Old 11-17-2005, 02:26 PM   #5
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043

Rep: Reputation: 83
That will do it.

That will certainly do it. I had the same frustration when I was first using php on my windows machine. I thought that IIS was not setup correctly and all that it was was a simple punctuation.
 
Old 11-17-2005, 03:37 PM   #6
arichardson
LQ Newbie
 
Registered: Nov 2005
Posts: 25

Original Poster
Rep: Reputation: 15
I just noticed that this thread was done twice. I don't understand why LOL
 
Old 11-17-2005, 03:43 PM   #7
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043

Rep: Reputation: 83
I noticed that too but I thought it was an accident so I thought Someone would catch it.
 
Old 11-18-2005, 07:13 AM   #8
Simon_6162
Member
 
Registered: Jul 2004
Location: UK
Distribution: Fedora, Gentoo, Redhat Enterprise
Posts: 141

Rep: Reputation: 16
i did this last week as well, you should turn on show all errors and warning while you are developing scripts.

this can be done by editing the /etc/php.ini file and the restarting apache
on mine its about line 285 set both of these

error_reporting = E_ALL
display_errors = On
 
Old 11-18-2005, 07:28 AM   #9
arichardson
LQ Newbie
 
Registered: Nov 2005
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Simon_6162
i did this last week as well, you should turn on show all errors and warning while you are developing scripts.

this can be done by editing the /etc/php.ini file and the restarting apache
on mine its about line 285 set both of these

error_reporting = E_ALL
display_errors = On
Excellent tip !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
php will NOT work correctly :( arichardson Fedora 3 11-17-2005 03:10 PM
PhP not working correctly in Suse 9.3 webwolf70 Suse/Novell 14 10-29-2005 09:33 AM
Apache-ssl not correctly parsing php files jme Linux - Software 2 05-03-2005 12:04 PM
PHP not working correctly AMMullan Programming 4 07-07-2004 02:32 PM
Crypt in PHP and RH8 not working correctly. sschueller Linux - Software 0 03-06-2003 05:10 PM


All times are GMT -5. The time now is 10:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration