Archived

This forum has been archived. Please start a new discussion on GitHub.

Almost breakdown,please help me!PHP+SSL

Sorry to interrupt U again~~
It works very well when I use php files as client via tcp/udp, but now the protocol needs to be changed to SSL.

I modified my php file to
$p = $ICE->stringToProxy("Factory:ssl -h 192.168.8.8 -p 10001");

and then added ice.config to php.ini,which contains this contents:
Ice.Plugin.IceSSL=IceSSL:create
IceSSL.DefaultDir=../../certs
IceSSL.ImportCert.CurrentUser.Root=cacert.pem
IceSSL.CertAuthFile=cacert.pem
IceSSL.CertFile=sdfds.pem
IceSSL.KeyFile=sdsds.pem

But it doesn't work~~~

I just thought that I should load ssl plugin, so I added this sentense in php.ini:
extension=libIceSSL.so
But the system showed that "maybe not a PHP library"

So...I have no idea now...Please~~

Comments

  • mes
    mes California
    Hi,

    When you say "it doesn't work", what exactly do you mean? Also, please tell us which operating system you're using and which version of PHP.

    When you enable the IceSSL plugin, Ice will attempt to dynamically load the IceSSL shared library. Since Ice is executing inside PHP, which is executing inside the web server, the IceSSL shared library must reside in a directory that is in the web server's shared library search path.

    Regards,
    Mark
  • mes wrote: »
    Hi,

    When you say "it doesn't work", what exactly do you mean? Also, please tell us which operating system you're using and which version of PHP.

    When you enable the IceSSL plugin, Ice will attempt to dynamically load the IceSSL shared library. Since Ice is executing inside PHP, which is executing inside the web server, the IceSSL shared library must reside in a directory that is in the web server's shared library search path.

    Regards,
    Mark

    Thank you very much for your reply~

    "It doesn't work" means that PHP client can't connect to C++ Server, which works very well via tcp/udp. Either Server or Client is built with linux 5 , apache2.2.4 & PHP 5.2.3.

    I'll check whether the IceSSL plugin can be loaded by the web server and tell you the result soon
  • I have tried many methods
    1,Copy libIcePHP.so.3.3.0 to apache/lib/
    2,Add /opt/Ice3.3.0 & /usr/lib to enviroment variable
    3,Add Lines "LoadModule IceSSL_module /opt/Ice3.3.0/lib/libIceSSL.so.3.3.0"
    Then when I started the apache server, the error message is "Can't locate API module structure 'IceSSL_module' in file /opt/Ice3.3.0/lib/libIceSSL.so.3.3.0: undefined symbo:IceSSL_module"

    How can I make my web server load IceSSL?
  • mes
    mes California
    I just thought that I should load ssl plugin, so I added this sentense in php.ini
    IceSSL is an Ice plug-in, so you can't load it into PHP or Apache. If IcePHP has been working with TCP, then your system already seems to be configured correctly. As long as the IceSSL shared library is in the same directory as the Ice shared library, you shouldn't need to change the web server or PHP configurations.
    Ice.Plugin.IceSSL=IceSSL:create
    IceSSL.DefaultDir=../../certs
    IceSSL.ImportCert.CurrentUser.Root=cacert.pem
    IceSSL.CertAuthFile=cacert.pem
    IceSSL.CertFile=sdfds.pem
    IceSSL.KeyFile=sdsds.pem
    Keep in mind that when you use a relative path name as in IceSSL.DefaultDir above, it is relative to the current working directory of the executable (which is Apache). I recommend changing this value to be an absolute path name instead, just to eliminate it as a potential source of problems.

    Are you getting any error messages in the Apache logs related to Ice or IceSSL?

    Regards,
    Mark
  • mes wrote: »
    IceSSL is an Ice plug-in, so you can't load it into PHP or Apache. If IcePHP has been working with TCP, then your system already seems to be configured correctly. As long as the IceSSL shared library is in the same directory as the Ice shared library, you shouldn't need to change the web server or PHP configurations.


    Keep in mind that when you use a relative path name as in IceSSL.DefaultDir above, it is relative to the current working directory of the executable (which is Apache). I recommend changing this value to be an absolute path name instead, just to eliminate it as a potential source of problems.

    Are you getting any error messages in the Apache logs related to Ice or IceSSL?

    Regards,
    Mark

    OH YEAH!!It works~~

    I checked the file ice.config. and change the value of IceSSL.DefaultDir to be an absolute path name, and all problems were readily solved!

    Thank you very much for your help

    Regards,
    Tony