apache2 & two php versions, how to use specific version


 
Thread Tools Search this Thread
Top Forums Web Development apache2 & two php versions, how to use specific version
# 1  
Old 04-24-2009
apache2 & two php versions, how to use specific version

Hi all,

I have my Debian web server, where apache2 and php 5.2.0 are installed from debian package. It worked fine, both in CLI & Browser.

Recently i installed the php 5.2.9 from the source. To verify it i executed the "php --version" and it is showing 5.2.9 . But in the browser still it is showing the older version ?

Why apache2 will not take the newest php version by default ? And now how i can insist apache2 to use this php version ? Kindly guide me.
# 2  
Old 04-24-2009
The version that is loaded by Apache is determined by the version that is seen by Apache, i.e. the one that is dumped in the Apache modules directory. If your installed version does not overwrite the one in that directory (presumably installed from the package tree), the distribution's version will be served.

Whether you can use your compiled version depends on whether your compile process has created a libphp5.so. If there is one, you can then try to overwrite and see if it works.

If you compile PHP as CLI or CGI, then you will not get that shared library. Then you will need to recompile your PHP. For details, please check the PHP manual for compilation hints.
# 3  
Old 04-25-2009
Yes, you are right that the current compilation has not generated the libphp5.so, bcoz i did is

./configure
make && make install

which has not created any libphp5.so file.

So i tried doing,
./configure --with-apxs

I believe this is the way to create the libphp5.so ? Am i right in saying this ??

And while doing make i am facing the following error ?
make: *** [sapi/apache2handler/mod_php5.lo] Error 1

I searched, and tried hard to rectify the error and no progress in it.

---

Actually i have Debian Etch, where there is no package for the php 5.2.9 so i am installing from source which is making these issues ... Please help me solving the above issue, and guide me in installing 5.2.9 in Debian Etch 3.0 .

Any help is appreciated !
# 4  
Old 04-26-2009
Any additional error messages above that line? I guess you may have omitted some. You should be quoting all the relevant error messages or no one will be able to help you. Thank you.

By the way, you probably want to try --with-apxs2 if you have Apache 2.

PHP: Apache 2.0 on Unix systems - Manual
# 5  
Old 04-27-2009
Thanks for your time.

This is the command which i give in the dir "./php-5.2.9".

$ ./configure --with-apxs2

This got executed successfully and while executing make i face the following error,

In file included from /root/php-5.2.9/sapi/apache2handler/mod_php5.c:26:
/root/php-5.2.9/sapi/apache2handler/php_apache.h:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php5_module'
/root/php-5.2.9/sapi/apache2handler/php_apache.h:38: error: expected specifier-qualifier-list before 'apr_bucket_brigade'
/root/php-5.2.9/sapi/apache2handler/php_apache.h:51: error: expected ')' before '*' token
/root/php-5.2.9/sapi/apache2handler/php_apache.h:52: error: expected ')' before '*' token
/root/php-5.2.9/sapi/apache2handler/php_apache.h:56: error: expected ')' before '*' token
/root/php-5.2.9/sapi/apache2handler/mod_php5.c:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'module'
make: *** [sapi/apache2handler/mod_php5.lo] Error 1


What could be the issue ?
# 6  
Old 04-27-2009
This is unusual.

Are you sure you have run this from a clean source tree? That is, either you run a "make distclean" before you try "configure - make" again, or you try again with a source tree extracted fresh from tarball.
# 7  
Old 04-27-2009
I still face the same error, i downloaded the source from php.net.

1. Source Extracted:
I extracted the source fresh from the tar ball.

2. configure
configured it as,
Code:
./configure --with-apxs2=/usr/bin/apxs

3. make
while executing make, the following is the last part of the error.

Code:
/bin/sh /root/sathiya/php-5.2.9/libtool --silent --preserve-dup-deps --mode=compile /root/sathiya/php-5.2.9/meta_ccld  -IZend/ -I/root/sathiya/php-5.2.9/Zend/ -DPHP_ATOM_INC -I/root/sathiya/php-5.2.9/include -I/root/sathiya/php-5.2.9/main -I/root/sathiya/php-5.2.9 -I/usr/include/libxml2 -I/root/sathiya/php-5.2.9/ext/date/lib -I/root/sathiya/php-5.2.9/TSRM -I/root/sathiya/php-5.2.9/Zend  -D_REENTRANT  -I/usr/include -g -O2 -pthread -DZTS  -prefer-non-pic -c /root/sathiya/php-5.2.9/Zend/zend_object_handlers.c -o Zend/zend_object_handlers.lo
/bin/sh /root/sathiya/php-5.2.9/libtool --silent --preserve-dup-deps --mode=compile /root/sathiya/php-5.2.9/meta_ccld  -IZend/ -I/root/sathiya/php-5.2.9/Zend/ -DPHP_ATOM_INC -I/root/sathiya/php-5.2.9/include -I/root/sathiya/php-5.2.9/main -I/root/sathiya/php-5.2.9 -I/usr/include/libxml2 -I/root/sathiya/php-5.2.9/ext/date/lib -I/root/sathiya/php-5.2.9/TSRM -I/root/sathiya/php-5.2.9/Zend  -D_REENTRANT  -I/usr/include -g -O2 -pthread -DZTS  -prefer-non-pic -c /root/sathiya/php-5.2.9/Zend/zend_objects_API.c -o Zend/zend_objects_API.lo
/bin/sh /root/sathiya/php-5.2.9/libtool --silent --preserve-dup-deps --mode=compile /root/sathiya/php-5.2.9/meta_ccld  -IZend/ -I/root/sathiya/php-5.2.9/Zend/ -DPHP_ATOM_INC -I/root/sathiya/php-5.2.9/include -I/root/sathiya/php-5.2.9/main -I/root/sathiya/php-5.2.9 -I/usr/include/libxml2 -I/root/sathiya/php-5.2.9/ext/date/lib -I/root/sathiya/php-5.2.9/TSRM -I/root/sathiya/php-5.2.9/Zend  -D_REENTRANT  -I/usr/include -g -O2 -pthread -DZTS  -prefer-non-pic -c /root/sathiya/php-5.2.9/Zend/zend_default_classes.c -o Zend/zend_default_classes.lo
/bin/sh /root/sathiya/php-5.2.9/libtool --silent --preserve-dup-deps --mode=compile /root/sathiya/php-5.2.9/meta_ccld  -IZend/ -I/root/sathiya/php-5.2.9/Zend/ -DPHP_ATOM_INC -I/root/sathiya/php-5.2.9/include -I/root/sathiya/php-5.2.9/main -I/root/sathiya/php-5.2.9 -I/usr/include/libxml2 -I/root/sathiya/php-5.2.9/ext/date/lib -I/root/sathiya/php-5.2.9/TSRM -I/root/sathiya/php-5.2.9/Zend  -D_REENTRANT  -I/usr/include -g -O2 -pthread -DZTS  -prefer-non-pic -c /root/sathiya/php-5.2.9/Zend/zend_execute.c -o Zend/zend_execute.lo
/bin/sh /root/sathiya/php-5.2.9/libtool --silent --preserve-dup-deps --mode=compile /root/sathiya/php-5.2.9/meta_ccld  -DLINUX=22 -DEAPI -DTARGET="apache" -DHAVE_SET_DUMPABLE -DDB_DBM_HSEARCH=1 -DDEV_RANDOM=/dev/random -DUSE_HSREGEX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/apache-1.3   -Isapi/apache2handler/ -I/root/sathiya/php-5.2.9/sapi/apache2handler/ -DPHP_ATOM_INC -I/root/sathiya/php-5.2.9/include -I/root/sathiya/php-5.2.9/main -I/root/sathiya/php-5.2.9 -I/usr/include/libxml2 -I/root/sathiya/php-5.2.9/ext/date/lib -I/root/sathiya/php-5.2.9/TSRM -I/root/sathiya/php-5.2.9/Zend  -D_REENTRANT  -I/usr/include -g -O2 -pthread -DZTS  -prefer-non-pic -c /root/sathiya/php-5.2.9/sapi/apache2handler/mod_php5.c -o sapi/apache2handler/mod_php5.lo
In file included from /root/sathiya/php-5.2.9/sapi/apache2handler/mod_php5.c:26:
/root/sathiya/php-5.2.9/sapi/apache2handler/php_apache.h:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php5_module'
/root/sathiya/php-5.2.9/sapi/apache2handler/php_apache.h:38: error: expected specifier-qualifier-list before 'apr_bucket_brigade'
/root/sathiya/php-5.2.9/sapi/apache2handler/php_apache.h:51: error: expected ')' before '*' token
/root/sathiya/php-5.2.9/sapi/apache2handler/php_apache.h:52: error: expected ')' before '*' token
/root/sathiya/php-5.2.9/sapi/apache2handler/php_apache.h:56: error: expected ')' before '*' token
/root/sathiya/php-5.2.9/sapi/apache2handler/mod_php5.c:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'module'
make: *** [sapi/apache2handler/mod_php5.lo] Error 1

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Web Development

php showing 2 versions

Fedora core 5 upgraded PHP php -v PHP 5.3.8 (cli) (built: Sep 30 2011 05:55:57) Copyright (c) 1997-2011 The PHP Group but if I also created a <?php phpinfo() ?> doc and it reports as 5.1.6 still something missing somewhere? (1 Reply)
Discussion started by: ippy98
1 Replies

2. Solaris

Please Help me about php&apache2 onSol10

Ok. I'm have Apache2 build on Solaris10 release 10/9 and I installed Mysql that could work. but I install php5 by pkgadd this packet install in /usr/local/php and i edit httpd.conf Insert "LoadModule php5_module libexec/libphp5.so" after edited httpd.conf so i restart httpd by... (1 Reply)
Discussion started by: infjustice
1 Replies

3. Programming

pythonqt scriptint & orting to lower version

I am facing some problems in deploying my application for lower version of qt. Basically i want to generate scripts for my application and I have chosen pythonqt for this purpose. Pythonqt has the problem with lower version of Qt (Qt 4.5.2) and also with Higher version of Qt (Qt 4.7). So I... (1 Reply)
Discussion started by: sujandasmahapat
1 Replies

4. AIX

Does anyone know the version of make on AIX 5.1 & 5.3?

Could you tell me the version of default make on AIX 5.1 & 5.3? (2 Replies)
Discussion started by: redraiment
2 Replies

5. UNIX for Dummies Questions & Answers

How to compare 2 files & get specific value & replace it in other file.

Hiiii Friends I have 2 files with huge data. I want to compare this 2 files & if they hav same set of vales in specific rows & columns i need to get that value from one file & replace it in other. For example: I have few set data of both files here: a.dat: PDE-W 2009 12 16 5 29 11.11 ... (10 Replies)
Discussion started by: reva
10 Replies

6. Shell Programming and Scripting

PHP read large string & split in multidimensional arrays & assign fieldnames & write into MYSQL

Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP. I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies

7. SCO

SCO & Informix SE version 7

hi, I need to download Informix SE version 7 for SCO but i could'nt find the link. please if someone can send me the link. thinks. (1 Reply)
Discussion started by: whisper
1 Replies

8. Shell Programming and Scripting

Awk: Version && nextfile

How can I find which version of Awk is installed? OpSystem is HPUX 11.x I am getting an error when trying to use the keyword nextfile and I dont know why! (Well, I can only assume that I have am using a version of Awk that does not support nextfile. However, according to O'Reilly, nextfile is... (3 Replies)
Discussion started by: google
3 Replies

9. UNIX for Dummies Questions & Answers

What is the difference : SunOS & Solaris Version.

Sorry I think someone already pointed out this but I couldn't find it. Please tell me what is the difference between SunOS Version and Solaris Version. What is the purpose of maintaining these two things ? Thanks (2 Replies)
Discussion started by: champion
2 Replies
Login or Register to Ask a Question