LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't get PHP to run (https://www.linuxquestions.org/questions/linux-newbie-8/cant-get-php-to-run-195387/)

Ham1am 06-19-2004 12:58 PM

Can't get PHP to run
 
Hi folks. :newbie: here.. :/

I've installed RH 9.0.. struggled like mad to get my network card running.. and then I read the docs.. :)

I've got apache running, but PHP doesn't seem to be working. I found a page on google where if PHP is working, it should pass the info to the browser, and it's not.

Code:

<html>
<head>
        <title>PHP Test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
        <h1>PHP Test</h1>
        <p>
        <b>An Example of PHP in Action</b><br />
                <?php echo "The Current Date and Time is: <br>";
                        echo date("g:i A l, F j Y.");?>
        </p>

        <h2>PHP Information</h2>
        <p>
                <?php phpinfo(); ?>
        </p>
</body>
</html>

What my browser returns is this:

PHP Test
An Example of PHP in Action
PHP Information


I've searched high and low for a FAQ or doc, but having no luck. What'd I forget or miss?

Thanks for the help.

Seventh 06-19-2004 01:34 PM

What does php -v from a terminal get you?

Ham1am 06-19-2004 03:17 PM

Quote:

Originally posted by Seventh
What does php -v from a terminal get you?
Hello Seventh, thanks for the reply

Version 4.2.2

Seventh 06-19-2004 03:24 PM

Been a bit since I've messed with this, but in httpd.conf, you should have:

AddType application/x-httpd-php .php

and a LoadModule line.

Can you post your httpd.conf?

I'm by no means an expert, but I'll help as much as I can. :)

Seventh 06-19-2004 03:28 PM

Also, I'm pretty sure the following needs to be in http.conf:

Code:

<Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
</Files>


Ham1am 06-19-2004 05:16 PM

Quote:

Originally posted by Seventh
Also, I'm pretty sure the following needs to be in http.conf:

Code:

<Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
</Files>


Hello again Seventh :)

I didn't have any of the lines.. I added AddType, and tried to do the AddModule.. but I'm not sure what needs to be in there.. so I did some searching and some guessing, however I didn't have much luck. I did manage to get httpd started again (with a warning message) but php still doesn't seem to work.
Code:

[root@localhost conf]# service httpd start
Starting httpd: [Sat Jun 19 18:05:22 2004] [warn] module php4_module is already
loaded, skipping

I'd attach my httpd.conf file, but it's 3 meg.. and I can't seem to find the attach button anyway.. :) Here's the things that might be of interest though:

Code:

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 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 headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.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 cgi_module modules/mod_cgi.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 php4_module modules/libphp4.so (not sure this is correct)

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

What else might be of interest?

Thanks a bunch Seventh!!


All times are GMT -5. The time now is 09:01 PM.