Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: apache/php problems

  1. #1
    Guest

    apache/php problems

    Hey guys and gals, I was trying to setup my webserver again and ran into some probs. I installed apache, php, and mysql via rpm and was editing my httpd.conf file setting everything up. ANyway, to make a long story short, I cant get it to parse php and show the phpinfo page. I am using rh7.2, and the httpd.conf file doesnt have any php stuff commented out. It does have and <ifdefine Have_PHP4> section that says LoadModule php4_module that is also uncommented. What have I missed?

  2. #2
    Mentor coltrane's Avatar
    Join Date
    May 2001
    Location
    North Carolina
    Posts
    1,390

    Re: apache/php problems


    1) make sure php is loaded as an Apache Module

    2) make sure your "Directory Index" line reads
    "DirectoryIndex index.html index.php"
    3) check out your If Module statements, they should look something like this:
    <IfModule mod_php3.c>
    AddType application/x-httpd-php3 .php3
    AddType application/x-httpd-php3-source .phps
    AddType application/x-httpd-php3 .phtml
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps
    4) Last, but not least, make sure your LoadModule/AddModule statements are accurate.

  3. #3
    Guest

    Re: apache/php problems

    this might be a stupid question, but how do I load it as a module?

  4. #4
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re: apache/php problems

    And check that the httpd is running with a flag: -DHAVE_PHP4

  5. #5

    Re: apache/php problems

    I have found that with redhat, installing the php rpms autofixes the httpd.conf file.

    Make a file, named test.php inside it put this:

    Code:
    <html>
    <?php phpinfo(); ?>
    </html>
    View this file in a browser, you should have a crapload of php info now...

  6. #6
    Guest

    Re: apache/php problems

    I dont have the Have_php4 flag running. How do I start that? I tried to post some of the conf file to help out, but it kept giving me an error saying my post was to large.

  7. #7
    Mentor coltrane's Avatar
    Join Date
    May 2001
    Location
    North Carolina
    Posts
    1,390

    Re: apache/php problems

    you can install php on linux standalone, as well as a php module in Apache....the latter being the only way you can get it to parse php files.

    install mod_php. You may/may not have to recompile Apache.

    and you shouldnt have to start the http daemon with any flags...if your httpd.conf file is setup properly, everything should come up ok.

    Here a thought, tail -f var/log/httpd/error_log and then restart your httpd daemon....you'll know if php is loaded as a module or not.

  8. #8
    Guest

    Re: apache/php problems

    THats the problem. I didnt compile it. I installed from rpm. I think I will dump the rpm for php, apache, and mysql and compile them all from source. Seems to work much better.

  9. #9
    Mentor coltrane's Avatar
    Join Date
    May 2001
    Location
    North Carolina
    Posts
    1,390

    Re: apache/php problems

    NOOOO

    just reinstall Apache

    My install is all rpm....I had nothing but problems installing it from source

  10. #10

    Re: apache/php problems


    THats the problem. I didnt compile it. I installed from rpm. I think I will dump the rpm for php, apache, and mysql and compile them all from source. Seems to work much better.
    You might want to rpm -e apache and remove the conf files if you've messed with them a bunch.

    From my 7.1 box:

    [root@anakin /root]# rpm -qa |egrep -i php
    php-4.0.4pl1-9
    php-devel-4.0.4pl1-9
    php-mysql-4.0.4pl1-9

    and php works like a charm....

    for php, you are using redhat provided rpm's right?

Similar Threads

  1. Apache 2.0.49/Php 4.3
    By in forum Linux - General Topics
    Replies: 1
    Last Post: 01-23-2006, 09:58 AM
  2. apache+ssl
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 03-27-2003, 01:25 PM
  3. PHP and apache 2x
    By Blaqb0x in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 11-29-2002, 05:02 AM
  4. Apache problems
    By CP in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 06-18-2002, 03:46 AM
  5. Apache problems
    By CP in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 01-14-2002, 10:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •