- problem with PHP script

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

- problem with PHP script

Muriel Keribin
Hello,

I have a problem with the PHP script of Openbabel (I must use it for a project).

I downloaded it from the git repository and I compile with php binding
($ cmake -DBUILD_GUI=FALSE -DCMAKE_INSTALL_PREFIX=/usr/local/openbabel -DRUN_SWIG=ON -DPHP_BINDINGS=ON .. )
The installation seems to work (two test of the 155 failed, without php all tests works but I do not think it is a big issue). But I cannot launch the php script.
I am obtaining the following error :

PHP Warning:  dl(): Dynamically loaded extensions aren't enabled in /usr/local/openbabel/lib/openbabel.php on line 22
PHP Fatal error:  Call to undefined function new_OBMol() in /usr/local/openbabel/lib/openbabel.php on line 7466

I tried to preload the libray, (LD_PRELOAD=...) but then it tells me it cannot read the library file.
I changed the new_OBMol() in new OBMol() in the openbabel.php, and then I obtain a error of memory allocation.

So I am wondering what I am doing wrong, and if I should change some options in the "swig"

I am using a virtual machine linux (x86_64-linux-gnu), gcc version 4.8.4, php 5.5.9 and swig 2.0.11

Thank you and kinds regards,
Muriel


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: - problem with PHP script

David Hall
Have you tried setting enable_dl to on? http://php.net/manual/en/info.configuration.php#ini.enable-dl

Or adding it as an extension that is loaded when PHP starts?

http://php.net/manual/en/ini.core.php#ini.extension

Note, with either options, you probably need to restart the web server after each change.

-David

> On Mar 17, 2016, at 6:21 AM, Muriel Keribin <[hidden email]> wrote:
>
> Hello,
>
> I have a problem with the PHP script of Openbabel (I must use it for a project).
>
> I downloaded it from the git repository and I compile with php binding
> ($ cmake -DBUILD_GUI=FALSE -DCMAKE_INSTALL_PREFIX=/usr/local/openbabel -DRUN_SWIG=ON -DPHP_BINDINGS=ON .. )
> The installation seems to work (two test of the 155 failed, without php all tests works but I do not think it is a big issue). But I cannot launch the php script.
> I am obtaining the following error :
>
> PHP Warning:  dl(): Dynamically loaded extensions aren't enabled in /usr/local/openbabel/lib/openbabel.php on line 22
> PHP Fatal error:  Call to undefined function new_OBMol() in /usr/local/openbabel/lib/openbabel.php on line 7466
>
> I tried to preload the libray, (LD_PRELOAD=...) but then it tells me it cannot read the library file.
> I changed the new_OBMol() in new OBMol() in the openbabel.php, and then I obtain a error of memory allocation.
>
> So I am wondering what I am doing wrong, and if I should change some options in the "swig"
>
> I am using a virtual machine linux (x86_64-linux-gnu), gcc version 4.8.4, php 5.5.9 and swig 2.0.11
>
> Thank you and kinds regards,
> Muriel
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: - problem with PHP script

Muriel Keribin
Hi,

I changed this enable_dl boolen in both /php5/apache2/php.ini and /php5/cli/php.ini . I obtained a more explicit message and I realised that the library called in the openbabel.php did not had the good name.

I changed openbabel.so by openbabel-php.so (in the /usr/local/openbabel/lib/openbabel.php file ) and now it is working when launched in shell (not yet in my browser).

Thank you very much;
Muriel

2016-03-17 14:50 GMT+01:00 David Hall <[hidden email]>:
Have you tried setting enable_dl to on? http://php.net/manual/en/info.configuration.php#ini.enable-dl

Or adding it as an extension that is loaded when PHP starts?

http://php.net/manual/en/ini.core.php#ini.extension

Note, with either options, you probably need to restart the web server after each change.

-David

> On Mar 17, 2016, at 6:21 AM, Muriel Keribin <[hidden email]> wrote:
>
> Hello,
>
> I have a problem with the PHP script of Openbabel (I must use it for a project).
>
> I downloaded it from the git repository and I compile with php binding
> ($ cmake -DBUILD_GUI=FALSE -DCMAKE_INSTALL_PREFIX=/usr/local/openbabel -DRUN_SWIG=ON -DPHP_BINDINGS=ON .. )
> The installation seems to work (two test of the 155 failed, without php all tests works but I do not think it is a big issue). But I cannot launch the php script.
> I am obtaining the following error :
>
> PHP Warning:  dl(): Dynamically loaded extensions aren't enabled in /usr/local/openbabel/lib/openbabel.php on line 22
> PHP Fatal error:  Call to undefined function new_OBMol() in /usr/local/openbabel/lib/openbabel.php on line 7466
>
> I tried to preload the libray, (LD_PRELOAD=...) but then it tells me it cannot read the library file.
> I changed the new_OBMol() in new OBMol() in the openbabel.php, and then I obtain a error of memory allocation.
>
> So I am wondering what I am doing wrong, and if I should change some options in the "swig"
>
> I am using a virtual machine linux (x86_64-linux-gnu), gcc version 4.8.4, php 5.5.9 and swig 2.0.11
>
> Thank you and kinds regards,
> Muriel
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140_______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss