Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

PHP 5.5.8 installation on Apache 2.4.7

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

PHP 5.5.8 installation on Apache 2.4.7

Postby ysrinivas » Wed Jan 15, 2014 12:45 pm

Hi,
on RHEL 5.8, I installed Apache Httpd 2.4.7 and then installed PHP 5.5.8, all by compiling the source files (.tar.gz)

However, Apache is failing to process the .php pages correctly.

Apache 2.4.7 installed from source code to: /apps/programs/apache/httpd-2.4.7

Compiled PHP from source code (configure, make, make test, make install) at : /apps/programs/setup/php-5.5.8
with the following:

Code: Select all
./configure --prefix=/apps/programs/php-5.5.8 \
   --with-config-file-path=/apps/programs/php-5.5.8/lib \
   --with-apxs2=/apps/programs/apache/httpd-2.4.7/bin/apxs \
   --with-curl=/apps/programs/curl-7.34.0 \
   --with-mysql \
   --enable-mysqlnd \
   --with-mysqli \
   --enable-calendar \
   --with-zlib \
   --enable-ftp \
   --enable-sockets \
   --enable-zip \
   --with-pear=/apps/programs/pear \
   --with-ldap

make

make test

make install


Code: Select all
[ysri@linuxdev php-5.5.8]$ pwd
/apps/programs/setup/php-5.5.8

[ysri@linuxdev php-5.5.8]$ make install
Installing PHP SAPI module:       apache2handler
/apps/programs/apache/httpd-2.4.7/build/instdso.sh SH_LIBTOOL='/apps/programs/apache/httpd-2.4.7/build/libtool' libphp5.la /apps/programs/apache/httpd-2.4.7/modules
/apps/programs/apache/httpd-2.4.7/build/libtool --mode=install install libphp5.la /apps/programs/apache/httpd-2.4.7/modules/
libtool: install: install .libs/libphp5.so /apps/programs/apache/httpd-2.4.7/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /apps/programs/apache/httpd-2.4.7/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /apps/programs/setup/php-5.5.8/libs'
chmod 755 /apps/programs/apache/httpd-2.4.7/modules/libphp5.so
[activating module `php5' in /apps/programs/apache/httpd-2.4.7/conf/httpd.conf]
Installing shared extensions:     /apps/programs/php-5.5.8/lib/php/extensions/no-debug-zts-20121212/
Installing PHP CLI binary:        /apps/programs/php-5.5.8/bin/
Installing PHP CLI man page:      /apps/programs/php-5.5.8/php/man/man1/
Installing PHP CGI binary:        /apps/programs/php-5.5.8/bin/
Installing PHP CGI man page:      /apps/programs/php-5.5.8/php/man/man1/
Installing build environment:     /apps/programs/php-5.5.8/lib/php/build/
Installing header files:          /apps/programs/php-5.5.8/include/php/
Installing helper programs:       /apps/programs/php-5.5.8/bin/
  program: phpize
  program: php-config
Installing man pages:             /apps/programs/php-5.5.8/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /apps/programs/pear/
[PEAR] Archive_Tar    - already installed: 1.3.11
[PEAR] Console_Getopt - already installed: 1.3.1
[PEAR] PEAR           - already installed: 1.9.4
Wrote PEAR system config file at: /apps/programs/php-5.5.8/etc/pear.conf
You may want to add: /apps/programs/pear to your php.ini include_path
[PEAR] Structures_Graph- already installed: 1.0.4
[PEAR] XML_Util       - already installed: 1.2.1
/apps/programs/setup/php-5.5.8/build/shtool install -c ext/phar/phar.phar /apps/programs/php-5.5.8/bin
ln -s -f /apps/programs/php-5.5.8/bin/phar.phar /apps/programs/php-5.5.8/bin/phar
Installing PDO headers:          /apps/programs/php-5.5.8/include/php/ext/pdo/



Restarted Apache

Issues:

1. We don't see php.ini file at /apps/programs/php-5.5.8/lib
Shouldn't this file be installed?

2. I put the following two files at /apps/programs/apache/httpd-2.4.7/htdocs

Code: Select all
[ysri@linuxdev htdocs]$ cat test.php
<?php
 phpinfo();
?>


Code: Select all
[ysri@linuxdev htdocs]$ cat phpinfo.php
<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>



a) On accessing the Apache default url, we get the page 'It Works!', so Apache is working great

b) On accessing test.php, it's a blank page

c) On accessing phpinfo.php, we get
PHP test
An Example of PHP in Action
"; echo date("g:i A l, F j Y.");?>
PHP Information


We would expect the above to show correct date and other php information
I verified that in Apache, modules/libphp5.so exists and is loaded by the httpd.conf file

Thanks,
-srinivas y.
ysrinivas
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Jan 15, 2014 12:33 pm

Re: PHP 5.5.8 installation on Apache 2.4.7

Postby ysrinivas » Mon Feb 03, 2014 10:59 am

I figured this out
1) The source package contains php.ini-development and php.ini-production, take the appropriate file and rename to php.ini

2) Make sure Apache httpd.conf has the following lines:
Code: Select all
LoadModule php5_module  modules/libphp5.so 
 
<FilesMatch \.php$> 
  SetHandler application/x-httpd-php 
</FilesMatch>
ysrinivas
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Jan 15, 2014 12:33 pm


Return to PHP Installation

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.