Click to See Complete Forum and Search --> : Apache & .php3


davo
08-18-2003, 06:32 PM
I've got a real web site up and running which works great and uses phpMyChat. This part also works great.

However on my home machine (running: RH 8.0, Linux 2.4.20, apache 2.0.40-11.5, php 4.2.2-8.0.8) at first it phpMyChat would not run, they were displayed as text. Seems that the .php3 file extensions were not recognized. After many changes to both the httpd.conf and /etc/httpd/conf.d/php.conf I managed to get it running. The command "httpd -l" yields the following info:
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c

However now when I am running phpMyChat and attempt to go into a chat room I get an error messge:

Fatal error: Call to undefined function: checkwords()

I am wondering if I need to reinstall Apache and compile from scratch?
Or do I need to install the library which will allow me to issue this command "LoadModule php3_module modules/libphp3.so" in my php.conf?
Or could it be something as simple as searching for all short calls to php? (eg <? vs <?php )

My entire error message is as follows:
0)) { // True IP behind a proxy $IP = $IP_array[0]; } else { // Proxy IP $IP = "p".$SimpleIP; }; break; case '2': // Proxy IP $IP = "p".$SimpleIP; }; ?> and Fabiano R. Prestes function checkwords ($String, $TestOnly) { // You can add the words you don't want users to use in the $BadWords array bellow. As an eregi // function is called to find them in strings, you may use valid POSIX 1003.2 regular expressions // (see second line of the array for an example). // Note that search is not case sensitive, except for special characters such as accentued ones. $BadWords = array ( "****", "****([[:alpha:]]*)" ); $ReplaceString = "@#$*!"; // String that will replace "swear words" // Don't modify lines bellow $Found = false; for (reset($BadWords); $ToFind = current($BadWords); next($BadWords)) { $Found = eregi(addslashes($ToFind), $String); if ($Found) { if ($TestOnly) { break; } else { $String = eregi_replace(addslashes($ToFind), $ReplaceString, $String); }; }; }; unset($BadWords); return ($TestOnly ? $Found : $String); } ?>
Fatal error: Call to undefined function: checkwords() in /var/www/html/pn/html/modules/phpMyChat/chat/lib/index.lib.php3 on line 231

I've searched and stumbled around 'till I'm tired of walking into walls in the dark. I'd be gratefull for any help.

Davo

davo
08-18-2003, 07:19 PM
Ok this problem was caused by one (at least one most likely more) <? vice <?php. Don't ya just hate it when a <possible> answer pops into your mind when you're in the middle of posting to a help forum. :rolleyes:

My main question still remains: do I need to install the library which will allow me to issue this command "LoadModule php3_module modules/libphp3.so" in my php.conf?

Meanwhile I'm off to search for a command (and with the way my last neuron has been misfiring some examples or tutorial) on how to search multiple files for "<?" but not "<?php".

Davo

theN
08-19-2003, 04:24 AM
Hi

Your httpd -l output indicates that PHP was compiled as a Dynamically Loadable module. So, you *should've* had a PHP LoadModule for PHP to work at all. Don't you have such a line in httpd.conf?

After the above assumption, if you already don't have such a line and PHP still works, then in some strange way you have *statically* compiled PHP but httpd -l won't show it!!

Maybe I didn't understand your post right :(

In the meanwhile you could switch ON short_open_tag in php.ini for <? to work.

regards
theN