extension loading works in command-line, but not Apache browser

This is a discussion on extension loading works in command-line, but not Apache browser within the PHP Language forums, part of the PHP Programming Forums category; Hi, all I'm trying to do is load the php_mapscript.so library into php. Here's the php file: ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-19-2007
edfialk
 
Posts: n/a
Default extension loading works in command-line, but not Apache browser

Hi, all I'm trying to do is load the php_mapscript.so library into php.

Here's the php file:
Code:

dl("php_mapscriot.so")
if (extension_loaded("MapScript"))
echo "works!";
else
echo "doesn't work!";
print_r(get_loaded_extensions());



Here's from the command line:
Code:

[edfialk@niceguy mapserver]$ php phpinfo.php
<HTML>
works!
<br>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] => pcntl [14] => overload [15] => mime_magic
[16] => iconv [17] => gmp [18] => gettext [19] => ftp [20]
=> exif [21] => dio [22] => dbx [23] => dba [24] => curl
[25] => ctype [26] => calendar [27] => bz2 [28] => bcmath
[29] => zlib [30] => openssl [31] => MapScript [32] => gd
[33] => ldap
)
<br>
Config file:/etc/php.ini


Here's from the browser:
(http://niceguy.wustl.edu/mapserver/phpinfo.php):
Code:

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
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 )


RAWR Permission denied?! Apache is run as 'nobody', the
php_mapscript.so has 777 permissions, user/group root/root.

I'm pretty desperate about this.
Anyone have any ideas?

Thanks in advance!
-Ed

Reply With Quote
  #2 (permalink)  
Old 01-19-2007
oeb
 
Posts: n/a
Default Re: extension loading works in command-line, but not Apache browser

edfialk wrote:
> Hi, all I'm trying to do is load the php_mapscript.so library into php.
>
> Here's the php file:
> Code:
>
> dl("php_mapscriot.so")
> if (extension_loaded("MapScript"))
> echo "works!";
> else
> echo "doesn't work!";
> print_r(get_loaded_extensions());
>
>
>
> Here's from the command line:
> Code:
>
> [edfialk@niceguy mapserver]$ php phpinfo.php
> <HTML>
> works!
> <br>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] => pcntl [14] => overload [15] => mime_magic
> [16] => iconv [17] => gmp [18] => gettext [19] => ftp [20]
> => exif [21] => dio [22] => dbx [23] => dba [24] => curl
> [25] => ctype [26] => calendar [27] => bz2 [28] => bcmath
> [29] => zlib [30] => openssl [31] => MapScript [32] => gd
> [33] => ldap
> )
> <br>
> Config file:/etc/php.ini
>
>
> Here's from the browser:
> (http://niceguy.wustl.edu/mapserver/phpinfo.php):
> Code:
>
> 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
> 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 )
>
>
> RAWR Permission denied?! Apache is run as 'nobody', the
> php_mapscript.so has 777 permissions, user/group root/root.
>
> I'm pretty desperate about this.
> Anyone have any ideas?
>
> Thanks in advance!
> -Ed
>


I don't know if it is relevant, but from
http://ie.php.net/dl

"As of PHP 5, the dl() function is deprecated in every SAPI except CLI.
Use Extension Loading Directives method instead."

oeb
Reply With Quote
  #3 (permalink)  
Old 01-19-2007
edfialk
 
Posts: n/a
Default Re: extension loading works in command-line, but not Apache browser

Thanks oeb, but I'm actually using 4.3.9

Reply With Quote
  #4 (permalink)  
Old 01-19-2007
Andy Hassall
 
Posts: n/a
Default Re: extension loading works in command-line, but not Apache browser

On 19 Jan 2007 08:54:00 -0800, "edfialk" <edfialk@gmail.com> wrote:

>Here's from the browser:
>(http://niceguy.wustl.edu/mapserver/phpinfo.php):


I just had a look, and you appear to have the extension loaded twice now -
lots of warnings about it not being able to re-register functions and
constants, but MapScript appears later in the phpinfo output...

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:41 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0