Apache Setup Problems

Home » General » Apache Setup Problems
General 5 Comments

Yes, I have installed PHP with yum. I used php* and just recently was told that there is nothing to install, it is all up to date. I
did a yum search php first, and tried to install a bunch of php modules, all of which are already installed. I had done that a while back. I think I might have done that from the CentOS desktop and now I’m working mainly from ssh.

By not working, I mean that the index.php file does not get processed as php
– yes, I checked that the file was renamed .php and that there is no .html file that could be run instead of the php file. So, I added to a test file named index.php, and in the body I have a simple
In the tutorials I found online, there is mention of the php configuration can be in the httpd.conf file or it can be called from that file. I have this line in the httpd.conf Include conf.d/*.conf Will that work? I am calling that from the file /etc/httpd/conf/httpd.conf so it seems like a relative path would be ../conf.d/*.conf, unless this is relative to this:
ServerRoot “/etc/httpd”

So, inside /etc/httpd/conf.d/php.conf I have

# 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

LoadModule php5_module modules/libphp5-zts.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

That should be enough at least get the phpinfo(); command to run. At some point, I got a message about there not being a php.ini file anywhere. Also, none of the other various php modules are being called anywhere. Still, I’m perplexed that I cannot get anything to run in terms of php. I could try a simple echo command to test something even simpler. Thanks, It’s great that there is such active response on this list… fast response times when seeking help. :-)

5 thoughts on - Apache Setup Problems

  • I am using http://www.dnsdynamic.org/ for the subdomain fwwebdev.dnsdynamic.com and I changed from http://freedns.afraid.org/ to dnsexit.com for the domain futurewavewebdevelopment.com since the servers at afraid.org seemed to have stopped forwarding the domain.
    So, it works, except for the php part. I made the files executable.
    What I mean by the php part doesn’t work is that it is just being thrown out. There is no attempt to process it as php. I think I mentioned elsewhere that the php was installed using yum. Thanks, Bruce

    —–Original Message—

  • Am 10.03.2013 09:28, schrieb Bruce Whealton:

    You shouldn’t. PHP pages work just fine without execute permission.

    So you aren’t getting 404 anymore?
    What do you mean by “thrown out”?
    Do you see a blank page?
    How do you know there’s no attempt? (As opposed to an attempt that fails for some reason yet to be determined.)
    What does your Apache error log say?

  • I didn’t think I needed to make the files executable. Anyway, the simple index.php has a title, an H1 tag and a couple php statements, one of which is phpinfo();
    My page, that I get has just the title and the content inside the h1 tag. When I view the source, there is nothing that was inside a php block. Meaning, it didn’t run the php code and output html.
    I was looking at the apache error log and not finding anything useful. Bruce

  • Am 11.03.2013 04:44, schrieb Craig White:

    cat /etc/httpd/conf.d/php.conf

    might also be interesting.

    And, while you’re at it, the HTML source of the page as it arrives in your browser, and the log entries Apache emits to access_log and error_log when you access the page. Including those you don’t find useful, if you please. They may well be useful to us.

Leave a Reply to Tilman Schmidt Cancel reply