Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As title says, i need to add a service httpd to get the php and apache2 talking to one another it seems (by line in httpd.conf: AddType application/x-httpd-php .php)

I uninstalled the default httpd that was in CentOS 6.2, then did source install for apache2.2.21 (latest), same source install for php5.3.9.

My guess is they are not talking to each other since service httpd is not being recognized at all atm.

How do I link my current apache2 to work as httpd service that does not exist?

share|improve this question
    
I doubt the source automatically installed a /etc/init.d/httpd script for you, hence the lack of service httpd command –  Tim Jan 19 '12 at 18:37
    
Please clarify, you are able to get apache (httpd) running or no? I assume it is running because you say httpd and php are not talking. Please explain what you mean by that and how you came to that conclusion. –  Tim Jan 19 '12 at 18:38
add comment

1 Answer

up vote 0 down vote accepted

What was the "./configure" settings of your Apache and PHP?

PHP should have included at least --with-apxs2=/usr/local/apache/bin/apxs (change the path to your compiled Apache).

Sample:

./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/lib/mysql --with-gd --with-jpeg-dir=/usr/lib --with-zlib
share|improve this answer
    
This is for Apache2: ./configure \ --prefix=/usr/local/apache2 \ --enable-so \ --enable-alias \ --enable-rewrite \ --enable-cache \ --enable-mem_cache \ --enable-headers \ --enable-expires \ --enable-auth-digest=shared \ --with-included-apr This is for PHP5: ./configure \ --prefix=/usr/local/php \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-curl \ --enable-pdo \ --with-pdo_mysql \ --with-mysql \ --with-mysqli \ --with-mssql \ --with-libdir=lib64 \ --with-openssl \ --enable-soap \ --enable-xml \ --enable-xmlreader \ --enable-xmlwriter \ --enable-ftp \ --enable-calendar –  Mr. Q Jan 19 '12 at 20:11
    
continuing with php... --enable-cli \ --with-pear \ --with-gd \ --enable-mbstring \ --with-mcrypt –  Mr. Q Jan 19 '12 at 20:13
    
I think I may have misunderstood. When you start Apache by hand, does this work? You only need the service added? –  jipiboily Jan 19 '12 at 20:14
    
I knew the apache was running because I started it using the apachectl command and ran the localhost page to make sure I was getting apache site. I say apache and php are not talking to one another because the simple phpinfo code and other echo commands show nothing but blank pages when i point to those .php files. Thank you –  Mr. Q Jan 19 '12 at 20:15
    
can you put your apache config in a gist or pastebin and update your question with it? What do you see in the access_log and error_log when you acces a phpinfo only page? –  jipiboily Jan 19 '12 at 20:17
show 12 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.