LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   apache not started (https://www.linuxquestions.org/questions/linux-newbie-8/apache-not-started-4175446571/)

ashokingole 01-21-2013 07:01 AM

apache not started
 
[root@localhost etc]# /etc/rc.d/init.d/apache start
httpd: Syntax error on line 145 of /usr/local/apache/conf/httpd.conf: Cannot load modules/libphp4.so
into server: /usr/local/apache/modules/libphp4.so: undefined symbol: ap_get_server_version

shivaa 01-21-2013 07:21 AM

Which distro? Have you added the script for first time or it was running and now not starting?
Did you make any changes in your system before reboot (I guess)? Provide some more details about issue.

kirukan 01-21-2013 08:14 AM

Quote:

Originally Posted by ashokingole (Post 4874641)
[root@localhost etc]# /etc/rc.d/init.d/apache start
httpd: Syntax error on line 145 of /usr/local/apache/conf/httpd.conf: Cannot load modules/libphp4.so
into server: /usr/local/apache/modules/libphp4.so: undefined symbol: ap_get_server_version

First make sure the module is exit in the module directory if exist just past the httpd.conf line how you load the module in apache?

sneakyimp 01-21-2013 01:33 PM

php 4 is *really old*. I wouldn't be surprised if the old shared object (libphp4.so) is not compatible with apache.

ashokingole 01-22-2013 01:54 AM

Please see the few line of my /etc/httpd.conf file

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@localhost ~]# vi /etc/httpd.conf
LoadModule alias_module modules/mod_alias.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php4_module /usr/local/apache/modules/libphp4.so
LoadModule php4_module modules/libphp4.so
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

And the libphp4.so present in this below location

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/etc/rc.d/init.d/apache start
httpd: Syntax error on line 145 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp4.so into server: /usr/local/apache/modules/libphp4.so: undefined symbol: ap_get_server_version
[root@localhost ~]# find / -name libphp4.so
/usr/local/src/php-4.4.6/libs/libphp4.so
/usr/local/src/php-4.4.6/.libs/libphp4.so
/usr/local/apache/modules/libphp4.so
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


What can i do to start apache server?

ashokingole 01-22-2013 02:01 AM

Quote:

Originally Posted by shivaa (Post 4874653)
Which distro? Have you added the script for first time or it was running and now not starting?
Did you make any changes in your system before reboot (I guess)? Provide some more details about issue.

i took below step to install apache & php

[root@localhost apache_1.3.0]#./configure \
--prefix=/usr/local/apache \
--enable-shared=max \
--enable-module=rewrite \
--enable-module=so

make && make install

[root@localhost php-4.4.6]#./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--disable-debug \
--enable-ftp \
--enable-inline-optimization \
--enable-magic-quotes \
--enable-mbstring \
--enable-mm=shared \
--enable-safe-mode \
--enable-track-vars \
--enable-trans-sid \
--enable-wddx=shared \
--enable-xml \
--with-dom \
--with-gd \
--with-gettext \
--with-mysql=/usr/local/mysql \
--with-regex=system \
--with-xml \
--with-zlib-dir=/usr/lib

make && make install

ashokingole 01-22-2013 02:43 AM

see the version my apache & php


[root@localhost apache_1.3.0]# /etc/rc.d/init.d/apache -v
Server version: Apache/2.4.3 (Unix)
Server built: Jan 21 2013 10:36:30
[root@localhost apache_1.3.0]# php -v
PHP 4.4.6 (cli) (built: Jan 21 2013 11:42:56)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
[root@localhost apache_1.3.0]#

sneakyimp 01-22-2013 08:40 AM

You should give up on PHP 4 and think about php 5.4 or 5.5 instead. Like I said, I wouldn't be surprised if php 4 and apache 2.4.3 were completely incompatible.

Or, you could try a much earlier version of apache -- and probably get your server hacked from all the old bugs,

ashokingole 01-22-2013 08:54 PM

Pleas suggest me to uninstall PHP 4.4.6 which is build and installed in given step, so that i can proceed with php 5.4 or 5.5.

cd /usr/local/src/php-4.4.6

./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--disable-debug \
--enable-ftp \
--enable-inline-optimization \
--enable-magic-quotes \
--enable-mbstring \
--enable-mm=shared \
--enable-safe-mode \
--enable-track-vars \
--enable-trans-sid \
--enable-wddx=shared \
--enable-xml \
--with-dom \
--with-gd \
--with-gettext \
--with-mysql=/usr/local/mysql \
--with-regex=system \
--with-xml \
--with-zlib-dir=/usr/lib

make && make install

cp php.ini-dist /usr/local/lib/php.ini

---------- Post added 01-23-13 at 08:24 AM ----------

Pleas suggest me to uninstall PHP 4.4.6 which is build and installed in given step, so that i can proceed with php 5.4 or 5.5.

cd /usr/local/src/php-4.4.6

./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--disable-debug \
--enable-ftp \
--enable-inline-optimization \
--enable-magic-quotes \
--enable-mbstring \
--enable-mm=shared \
--enable-safe-mode \
--enable-track-vars \
--enable-trans-sid \
--enable-wddx=shared \
--enable-xml \
--with-dom \
--with-gd \
--with-gettext \
--with-mysql=/usr/local/mysql \
--with-regex=system \
--with-xml \
--with-zlib-dir=/usr/lib

make && make install

cp php.ini-dist /usr/local/lib/php.ini

sneakyimp 01-24-2013 04:38 PM

I'm not entirely sure how to uninstall if you are compiling from source, you might try:
Code:

cd /usr/local/src/php-4.4.6p]
make uninstall

However, the PHP authors may not have provided an uninstall version.

It may be enough to simply download the source code of PHP 5.4 into a different directory and try the same configure/make/make install commands there.

On the other hand, compiling from source is sometimes tricky if you don't know what configure command to use. If you are using linux, you can use a package manager to auto-install such things.

On a debian-based system, you could do something like this:
Code:

apt-get install php5 php5-xmlrpc php5-gd php5-mysql
If you're on a red hat based system (e.g., Fedora or CentOS) then the command would be yum instead of apt-get and the package names would be different.


All times are GMT -5. The time now is 11:38 AM.