Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Trouble loading php module

Error when trying to apachectl start.



6:58 pm on Feb 9, 2007 (gmt 0)

5+ Year Member

I tried posting this in a php forum but after a week I only got a handful of views (not counting my own) and no replies. It's been a long hard road, with many obstacles, to my apache/mysql/php goal, but I can't let this one defeat me. When I apachectl start, I get:

httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: php_stream_context_get_option

Here's line 53:

LoadModule php5_module modules/libphp5.so

I'm running ubuntu 6.10x86 and my mysql was installed by apt-get mysql-server-5.0.
Here's my apache configure:

./configure \
--prefix=/usr/local/apache \
--enable-so \
--enable-cgi \
--enable-ingo \
--enable-rewrite \
--enable-speling \
--enable-usertrack \
--enable-deflate \
--enable-ssl \

And here's my php configure:

./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/var/lib/mysql \
--with-mysqli-dir=/usr/bin/mysql_config \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
--with-gettext \
--with-gdbm \
--with-openssl \
--with-xml \

And here's the result of make test for php (which was built and installed anyway):

Bug #37514 (strtotime doesn't assume year correctly). [ext/date/tests/bug37514.phpt]
date OO cloning [ext/date/tests/oo_002.phpt]
Bug #16069 [ext/iconv/tests/bug16069.phpt]
iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
mysql_fetch_array [ext/mysql/tests/002.phpt]
mysql_fetch_object [ext/mysql/tests/003.phpt]


2:26 pm on Feb 10, 2007 (gmt 0)

10+ Year Member

Unless you really need php 5.2 or something then you should always stick to the versions in the distribution.

sudo apt-get install mysql-server-5.0 apache2 php5

And here's the result of make test for php (which was built and installed anyway):

From what you say here, it sounds like you already have php installed (possibly from the distribution) and you are compiling the apache module against the headers from the source of a different version of PHP. This is unlikely to work. If you really want to build it all yourself then you'll have to remove any existing php installations and install the one you built from source.

Good luck.


4:37 pm on Feb 10, 2007 (gmt 0)

5+ Year Member

Thanks for the reply.

sudo apt-get install mysql-server-5.0 apache2 php5

Actually, that's the first thing I did, but I couldn't get any php pages to work - they'd always try to download and never display. So I removed the packages with apt-get remove mysql-server-5.0 apache2 php5, and started building from source with the help of some tutorials.

which was built and installed anyway

I should have wrote "which built" not "which was built". By this I meant that make make install didn't return any errors I could see and appeared to work (it was already off the system). Then, after things didn't seem to work, I did a make test to see if there was anything I missed. I'm not sure what to make of the report, which is why I posted it as an additional clue.

To clarify the current situation, mysql works fine, apache and php both appeared to compile without errors, but they seem to have problems. The issue at hand is that apachectl start returns an error - the first error in this journey that google hasn't been able to answer.


8:37 pm on Feb 10, 2007 (gmt 0)

10+ Year Member

Actually, that's the first thing I did, but I couldn't get any php pages to work - they'd always try to download and never display.

Trust me, there are no problems with the ubuntu mysql, apache or php5 packages.

It sounds like you tried to view a php page in your browser without having php installed & since the server didnt process it and send a mime-type header your browser got it as plaintext. Now, the annoying thing about many browsers (Always IE, though I have seen it happen in firefox) is that the browser will cache the file, so when you finally do get php working you attempt to access the php page and the browser just gives you an "open file or download" type dialog box as before and gives you the cached text version of the file... though if you access a differnt PHP page or clear your cache it will work fine. I have seen more than one sysadmin banging his head off his desk with this problem.

So, if I were you I'd re-install everything with APT and I bet you an ice cream it'll work if you clear your browsers cache.

However, if you really want to compile everything, the problem really is down to headers when you are compiling your app - probably you are compiling apache with the wrong PHP header files. Apache is trying to call a function php_stream_context_get_option which doesn't exist in the version you have installed... clear all traces of your old versions of apache and php, then clear all traces of the versions you built and installed manually (which will be a pain if you just did "make install") then start again.

When removing packages from debian / ubuntu apt-get remove doesn't do what you think it might. You will also need to do a dpkg --purge packagename. This will remove all config files and the like which are not removed by apt-get-remove.

Good luck :-) Please let me know how you get on.


2:26 pm on Feb 12, 2007 (gmt 0)

5+ Year Member

Your points make perfect sense. Thanks, man. I'm at work right now so I'll have to try that out when I get home.


6:09 pm on Feb 13, 2007 (gmt 0)

5+ Year Member

I removed the source files, apt-get removed, dkpg --purged everything, and cleared my browser cache. Then apt-get install apache2 php5 php5-mysql mysql-5.0-server. And it worked... sort of. PHP pages can now load so that resolves this thread. However I'll go ahead and say what I had to do next. My goal was to get joomla up and running. With the php issue resolved I could then access the install page. I changed some file permissions and edited a conf file but it still said mysql support was unavailable. After a lot of searching I found a really obscure solution. Apparently php 5 uses a new connector. So I had to edit the php code in the install page to connect to mysqli instead of mysql.

Now it's all good. Thanks for your help!


8:52 pm on Feb 13, 2007 (gmt 0)

10+ Year Member

apt-get install php5-mysql

...should let you use it without the hack. There's a php5-mysqli package too, should you need it... apt is you friend :-)

Glad to have been of service.


Featured Threads

Hot Threads This Week

Hot Threads This Month