PHP Problem ('undefined index', 'undefined function')
Hi,
I'm moving a website with PHP content from a Mac server to a Linux server (Redhat AS4), but at least one page is not working on the Linux host. Unfortunately, I know next to nothing about PHP. The problem page is showing up blank and Apache's error_log shows the following: Code:
[client 1.2.3.4] PHP Notice: Undefined index: q in /web/html/acad/dict/includes/search-commands.php on line 12, referer: http://ourhost.com/problem/path/ Line 12: Code:
$search_str = strtr($_GET['q'], array("*" => ".*")); Code:
if (mb_strlen($search_str, 'UTF-8') > 0) { Code:
[client 1.2.3.4] PHP Notice: Undefined variable: prefix in /web/html/acad/dict/includes/searchbox.php on line 5, referer: http://ourhost.com/problem/path/dict...est&fields=all This machine is running PHP 4.3.9 (also has php-mysql-4.3.9 and php-devel 4.3.9). The Mac server that it works on is running PHP 4.4.8. And another Linux machine it works on is running PHP 4.3.2 (also php-mysql and php-imap; same versions). Anyone have any ideas? I can provide more info about the PHP implementation or the system if needed, just let me know what you need. Thanks. |
Well, the first thing I'd try is to have the versions of all the involved software (Apache, MySQL, PHP) -EXACTLY- the same. I know the PHP docs say the the mb_str function should be available, but my guess is that at least some (but not neccesarily all) your problems originate from having two different versions that try to run code that appears to be version specific?
Additionally, it could also be character encodings, which almost certainly is handled differently on OSX vs. Linux...? Since the functions complaining seem to be codepage specific functions? |
just replace (mb_strlen($search_str, 'UTF-8') > 0)
with (strlen($search_str) > 0) your php doesn't support mb_strlen. you might have problem with non-utf characters |
All times are GMT -5. The time now is 07:47 PM. |