Page 1 of 1

extension loading works for command line but not browser

Posted: Wed Jan 17, 2007 10:58 am
by edfialk
Hi, here's my phpinfo.php test file:
//The php_mapscript.so is auto-loaded from php.ini

Code: Select all

if (extension_loaded("MapScript"))
        echo "works!";
  else
        echo "doesn't work!";
  print_r(get_loaded_extensions());
Here's from the command line:

Code: Select all

[edfialk@niceguy mapserver]$ php phpinfo.php 
<HTML>
works!<br>Array
(
    [0] => xml
    [1] => tokenizer
    [2] => standard
    [3] => session
    [4] => posix
    [5] => overload
    [6] => mysql
    [7] => ctype
    [8] => pcre
    [9] => MapScript
)
</HTML>
Here's from the browser: (http://niceguy.wustl.edu/mapserver/phpinfo.php)

Code: Select all

doesn't work!
Array ( [0] => yp [1] => xml [2] => wddx [3] => tokenizer [4] => sysvshm [5] => sysvsem [6] => standard [7] => sockets [8] => shmop [9] => session [10] => pspell [11] => posix [12] => pcre [13] => overload [14] => mime_magic [15] => iconv [16] => gmp [17] => gettext [18] => ftp [19] => exif [20] => dio [21] => dbx [22] => dba [23] => curl [24] => ctype [25] => calendar [26] => bz2 [27] => bcmath [28] => zlib [29] => openssl [30] => apache2handler [31] => gd [32] => ldap )
Totally different extensions loaded, and not the one I want!
Anyone have any ideas?

Thanks in advance!
-Ed

Posted: Wed Jan 17, 2007 11:44 am
by feyd
The library isn't a standard one, so I wouldn't expect it to be readily loaded in any hosting package. dl() may be of interest.

Posted: Wed Jan 17, 2007 2:36 pm
by edfialk
I've tried dl(), same thing as before. Works in command-line, but not in browser window.

I did, however, get this error in the browser window when using dl():

Warning: dl(): Unable to load dynamic library '/usr/lib64/php4/php_mapscript.so' - /usr/lib64/php4/php_mapscript.so: cannot open shared object file: Permission denied in /var/www/html/mapserver/phpinfo.php on line 22

I ran into this before, but I thought it was gone.

Again, this works perfectly in php command-line.

php_mapscript.so has read, write, and execute for everyone, so it should have the permissions.

Any ideas?
Thanks!
-Ed

Posted: Wed Jan 17, 2007 2:39 pm
by volka
Set read permissions for all

Code: Select all

chmod ugo+r /usr/lib64/php4/php_mapscript.so
then try again.

Posted: Wed Jan 17, 2007 3:01 pm
by edfialk
Still no luck. Same thing.

I feel like I need to tell Apache that it's okay if Apache accesses that file, as running php from the command-line has no problem with it.

So, does anyone know how i tell Apache to just the @#()$&*@# file?

Or, if anyone still has ideas, I'll try any and all of them.

-Ed

Posted: Wed Jan 17, 2007 3:13 pm
by feyd
check get_cfg_var('cfg_file_path') in both settings. If they are not the same, that may point to the reason.

Posted: Wed Jan 17, 2007 3:17 pm
by edfialk
:(

they are the same, it's /usr/local/lib/php.ini, the php.ini that is being used by my command-line.

Posted: Thu Jan 18, 2007 10:17 am
by edfialk
Ya the reason the command-line and web server were using different ini's is because they're different versions of PHP (4.4.2 for command-line, 4.3.9 for apache).
I didn't install it, I dont know why they're different versions, but I've got someone working on upgrading the apache version.

BUT, I don't think it'll help. I used the 4.3.9 php executable to run my phpinfo.php, and both versions worked on the command-line.
So, even using the apache php version worked on the command-line but not in the browser.

I'm getting pretttty desperate. Does anyone have any ideas?

Thanks!
-Ed