LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   php will NOT work correctly :( (https://www.linuxquestions.org/questions/fedora-35/php-will-not-work-correctly-383866/)

arichardson 11-16-2005 09:32 PM

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 :D

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

jstephens84 11-16-2005 11:03 PM

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.

arichardson 11-17-2005 07:17 AM

That's the very first line of my LoadModules section. Does it need to be last?

arichardson 11-17-2005 07:22 AM

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

jstephens84 11-17-2005 02:26 PM

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.

arichardson 11-17-2005 03:37 PM

I just noticed that this thread was done twice. I don't understand why LOL

jstephens84 11-17-2005 03:43 PM

I noticed that too but I thought it was an accident so I thought Someone would catch it.

Simon_6162 11-18-2005 07:13 AM

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

arichardson 11-18-2005 07:28 AM

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 ! ;)


All times are GMT -5. The time now is 05:59 PM.