Page 1 of 1

Apache not parsing

Posted: Wed Oct 09, 2002 7:24 pm
by oraknabo
I recently recompiled PHP on my server and now Apache outputs the scripts in text format in the browser.

I checked httpd.conf and php.ini and everything seems to be in
order:
---------------------------------------------------------------------

LoadModule php4_module modules/libphp4.so

AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps

;;;;;;;;;;;;;;;;;;;;

engine = On

short_open_tag = On

-----------------------------------------------------------------------

libphp4.so appears to be in the right directory and I ran a test php
file through the new install of PHP to test and it's working fine.

I even restarted http a couple of times, but it had no effect at all.

I've seen this mentioned a couple of times on news searches, but never with a reply. Has anyone here had this problem before?

Posted: Wed Oct 09, 2002 7:45 pm
by volka
maybe there's a ClearModuleList in your apache.conf
If so there is probably a list of AddModules behind that directive
append AddModule mod_php4.c and try again.

Posted: Wed Oct 09, 2002 7:51 pm
by oraknabo
Yeh, that one was already there too. This has me totally stumped.

Posted: Wed Oct 09, 2002 8:10 pm
by oraknabo
BTW, I doublechecked the configure options and sure enough, this was there:

--with-apxs=/usr/sbin/apxs

Just in case you were wondering :?

Posted: Thu Oct 10, 2002 1:38 pm
by oraknabo
SO I've been messing around with this more and here's the current state of this problem:

In httpd.conf AddModule mod_php4.c is in place just after php and php3.
Above, when <IfDefine HAVE_PHP4>
LoadModule php4_module modules/libphp4.so
</IfDefine>
is in the same location in the load order.

ServerRoot is "/etc/httpd" and libphp4.so is sitting in /etc/httpd/modules

When I run
/usr/sbin/apachectl start
I get
/usr/sbin/apachectl: line 198: 14797 Segmentation fault $HTTPD
/usr/sbin/apachectl start: httpd could not be started


when I comment out both the AddModule and the LoadModule for php4 I get no error, httpd starts but parses no php (of course).

Could the .so file be bad? Is there something wrong with php or is this just an Apache issue? Is there something I can do to the apachectl script to fix it?
I tested a simple "hello world" echo through php from the command line and it worked just fine.

I've read all the documentation on mod_so and as far as I can tell I've done everything right.

Posted: Thu Oct 10, 2002 9:15 pm
by oraknabo
I re-compiled PHP a couple more times and it's doing something I don't understand.

When I look at httpd.conf it has added
<IfDefine HAVE_PYTHON>
LoadModule python_module modules/mod_python.so
LoadModule php4_module /usr/lib/apache/libphp4.so
</IfDefine>


I have absolutely no idea why it would put the php module load in the python conditional :?

Anyway, now when I start apachectl it tells me php4.so is already loaded and fails.

If I comment out the module load in the python conditional I get the same Segmentation fault in my previous post. If I comment out the one in the php4 conditional but leave the other, httpd starts successfully but won't parse php again.

I am totally lost on this.

Posted: Fri Oct 11, 2002 2:41 am
by oraknabo
Even though I'm not getting replies I thought I'd go ahead and post because it's fun to watch me going down in flames, no?

------
Regardless of the above issue, when I compile PHP without Verisign PayFlow httpd starts without trouble and PHP is parsed.
Go here for the full story.
LibMcrypt doesn't seem to be causing any problems with PHP or Apache.

./configure i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --prefix=/usr --with-config-file-path=/etc --enable-force-cgi-redirect --disable-debug --enable-dbg=shared --with-dbg-profiler --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db3 --with-curl=/usr/bin --with-dom=/usr/lib --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-mm --with-openssl --with-png --with-pspell --with-regex=system --with-xml --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-debugger --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --without-oci8 --with-imap=shared --with-imap-ssl --with-kerberos=/usr/kerberos --with-ldap=shared --with-mysql=shared,/usr --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared --enable-memory-limit --enable-bcmath --enable-shmop --enable-versioning --enable-calendar --enable-dbx --enable-dio --enable-mcal --enable-mbstring --enable-mbstr-enc-trans --with-apxs=/usr/sbin/apxs --with-mcrypt --with-pfpro=/usr/local/verisign/payflowpro/linux/lib
I got this config string up to apxs from phpInfo. It is the original used by the RedHat install. Originally MySql worked, but now when I run make distclean and configure it like it was originally, I get Call to undefined function: mysql_connect(). I have seen this problem reported many, many times but rarely answered. As you can see MySql is in the config options, but somehow is not connecting with PHP after this recompile.

I have to figure this payflow issue out, but now I can't even get things back to the way they were! Can anyone help me? :x

For Posterity...

Posted: Fri Oct 11, 2002 2:39 pm
by oraknabo
Just in case this whole mess helps out anyone who is searching:

I stripped it down the compile to just payflow to see if there
was a conflict, but it still didn't work.
Then in a total stroke of luck I found this:

http://bugs.php.net/bug.php?id=11301

I moved SSL in the load order in httpd.conf while I had only and payflow
compiled in PHP and it works. The built in MySQL support kicked in and I
had both payflow AND MySQL support (though not shared).
I tried putting the entire list of options I included above
but there's still a conflict somewhere.
I pared it down to the most essential things my site needs and it all
seems to be working OK:
../configure i386-redhat-linux --with-config-file-path=/etc
--with-apxs=/usr/sbin/apxs --with-pfpro=/usr/local/verisign/payflowpro
--with-mcrypt
I may try to add a few more things at a time, but I can at least work with
this.

Posted: Mon Oct 21, 2002 11:04 am
by redbeardz
I think I am having the same problem. I have written a few php scripts and uploaded them to a web server. They worked great. I decided I wanted to try dual booting with Linux so I could learn Linux and Apache. So I installed Redhat 7.2 and choose the web server and development components. Apache and php were both installed and as far as I can tell they were configured correctly (I'm a newbie so I may be wrong here). But when I place my .php files in /var/www/html and point a browser at them, all that the browser displays is the code.

Is there a way to tell if Apache and php are configured right? Have you found any more answers to your problem?