Apache and soap

Apache and soap

am 07.01.2008 16:42:24 von marcomangiante

Hello,

I written a web service in c# and consumed it with a simple php client
script on IIS 7 without any problem. Now I'm trying to do the same on
apache. I installedthe mod_aspdotnet module, enabled soap extension in
php.ini, but when I try to start my simple php client sample, I obtain
the error:

Fatal error: Class 'SoapClient' not found in C:\Program Files\Apache
Software Foundation\Apache2.2\htdocs\simplerandomnumbertest.php on
line 2

The script in php is this:

$client = new SoapClient("http://localhost/randomnumberstr.wsdl");

$result = $client->getRandomNumber();

foreach ($result as $item)
print ("Random number is:\n$item");
?>


I understand that maybe in the apache web server is not loaded a
library to support soap: what type of library I must install?

--
Regards,

Marco Mangiante

Re: Apache and soap

am 07.01.2008 21:48:10 von shimmyshack

On Jan 7, 3:42 pm, marcomangiante wrote:
> Hello,
>
> I written a web service in c# and consumed it with a simple php client
> script on IIS 7 without any problem. Now I'm trying to do the same on
> apache. I installedthe mod_aspdotnet module, enabled soap extension in
> php.ini, but when I try to start my simple php client sample, I obtain
> the error:
>
> Fatal error: Class 'SoapClient' not found in C:\Program Files\Apache
> Software Foundation\Apache2.2\htdocs\simplerandomnumbertest.php on
> line 2
>
> The script in php is this:
>
> > $client = new SoapClient("http://localhost/randomnumberstr.wsdl");
>
> $result = $client->getRandomNumber();
>
> foreach ($result as $item)
> print ("Random number is:\n$item");
> ?>
>
> I understand that maybe in the apache web server is not loaded a
> library to support soap: what type of library I must install?
>
> --
> Regards,
>
> Marco Mangiante

its the php.ini file
not sure why you need to load the a

Re: Apache and soap

am 07.01.2008 21:50:32 von shimmyshack

On Jan 7, 3:42 pm, marcomangiante wrote:
> Hello,
>
> I written a web service in c# and consumed it with a simple php client
> script on IIS 7 without any problem. Now I'm trying to do the same on
> apache. I installedthe mod_aspdotnet module, enabled soap extension in
> php.ini, but when I try to start my simple php client sample, I obtain
> the error:
>
> Fatal error: Class 'SoapClient' not found in C:\Program Files\Apache
> Software Foundation\Apache2.2\htdocs\simplerandomnumbertest.php on
> line 2
>
> The script in php is this:
>
> > $client = new SoapClient("http://localhost/randomnumberstr.wsdl");
>
> $result = $client->getRandomNumber();
>
> foreach ($result as $item)
> print ("Random number is:\n$item");
> ?>
>
> I understand that maybe in the apache web server is not loaded a
> library to support soap: what type of library I must install?
>
> --
> Regards,
>
> Marco Mangiante

its te php.ini file, not sure why youre loading the aspdotnet module?
are you writing a script in asp.net to run on apache?
you need to load the php module

extension=php_soap.dll

write in php and get apache to execute files ending in .php using the
php module for apache. download xampp to get a head start if you are
unused to configuring php and apache, but be aware it is insecure to
start off with, meant only for developing, before you make the xampp
server public lock it down.

Re: Apache and soap

am 08.01.2008 12:04:50 von marcomangiante

Hello,

> its te php.ini file, not sure why youre loading the aspdotnet module?
> are you writing a script in asp.net to run on apache?

I loaded this module because I'm using asp.net in apche, and it works
without problem.

> you need to load the php module
>
> extension=php_soap.dll
>
> write in php and get apache to execute files ending in .php using the
> php module for apache.

I do all this stuff because I configured previously apache to work
with php, and it works. But I also enabled the extension in php.ini
file, but they don't work in apache.
If you write a simple php page with this code:

phpinfo();
?>

you can't see the soap extesion enabled, i.e., no soap information on
the info php page. Instead, on IIS7, soap extension works without
problem.

The only thing that is different and maybe can do cause the problem is
that the apache server is set on port 8080, but I don't know if this
is the problem.

Hope you can help.

--
Regards,

Marco Mangiante

Re: Apache and soap

am 08.01.2008 20:35:07 von Kees Nuyt

On Tue, 8 Jan 2008 03:04:50 -0800 (PST), marcomangiante
wrote:

>Hello,
>
>> its te php.ini file, not sure why youre loading the aspdotnet module?
>> are you writing a script in asp.net to run on apache?
>
>I loaded this module because I'm using asp.net in apche, and it works
>without problem.
>
>> you need to load the php module
>>
>> extension=php_soap.dll
>>
>> write in php and get apache to execute files ending in .php using the
>> php module for apache.
>
>I do all this stuff because I configured previously apache to work
>with php, and it works. But I also enabled the extension in php.ini
>file, but they don't work in apache.
>If you write a simple php page with this code:
>
> >phpinfo();
>?>
>
>you can't see the soap extesion enabled, i.e., no soap information on
>the info php page. Instead, on IIS7, soap extension works without
>problem.
>
>The only thing that is different and maybe can do cause the problem is
>that the apache server is set on port 8080, but I don't know if this
>is the problem.
>
>Hope you can help.

My guess is that php loads some other php.ini than you
think. You can force the correct php.ini in httpd.conf (or
one of its included .conf files).

Force PHP to use D:/bin/apache/conf/php.ini :
========
LoadModule php5_module \
"D:/bin/apache/bin/php5apache2_2.dll"
AddType application/x-httpd-php .php .phtml
PHPIniDir "D:/bin/apache/conf/"
========
Note: Line wraps are indicated with \
--
( Kees
)
c[_] As scarce as truth is, the supply has
always been in excess of demand. (#351)

Re: Apache and soap

am 09.01.2008 08:39:29 von marcomangiante

Hello,

> My guess is that php loads some other php.ini than you
> think. You can force the correct php.ini in httpd.conf (or
> one of its included .conf files).
>
> Force PHP to use D:/bin/apache/conf/php.ini :
> ========
> LoadModule php5_module \
> =A0 =A0 =A0 =A0 "D:/bin/apache/bin/php5apache2_2.dll"
> AddType application/x-httpd-php .php .phtml
> PHPIniDir "D:/bin/apache/conf/"
> ========
> Note: Line wraps are indicated with \

thank you very much, I finally resolved the problem. I noticed that
apache point to a php.ini in c:\windows, but it wasn't here. I tried
to place it in that directory, but nothing happens. Now, as you
suggest, I copy it in the apache conf directory and seems to work
without problem.

I trie also the configuration of IIS7, and seems have no conflict with
the 2 web server and 2 php.ini: infact, one for IIS7 is in the php
directory, the other, for apche, is now it the latter conf directory.

Do you think I can find a problem with 2 php.ini files loaded? The
only difference between the 2 files is the doc_directory pointed.

--
Regards,

Marco Mangiante

Re: Apache and soap

am 09.01.2008 13:22:42 von Kees Nuyt

On Tue, 8 Jan 2008 23:39:29 -0800 (PST), marcomangiante
wrote:

>Hello,
>
>> My guess is that php loads some other php.ini than you
>> think. You can force the correct php.ini in httpd.conf (or
>> one of its included .conf files).
>>
>> Force PHP to use D:/bin/apache/conf/php.ini :
>> ========
>> LoadModule php5_module \
>>         "D:/bin/apache/bin/php5apache2_2.dll"
>> AddType application/x-httpd-php .php .phtml
>> PHPIniDir "D:/bin/apache/conf/"
>> ========
>> Note: Line wraps are indicated with \
>
>thank you very much, I finally resolved the problem. I noticed that
>apache point to a php.ini in c:\windows, but it wasn't here. I tried
>to place it in that directory, but nothing happens. Now, as you
>suggest, I copy it in the apache conf directory and seems to work
>without problem.

I'm glad that solved it.

>I trie also the configuration of IIS7, and seems have no conflict with
>the 2 web server and 2 php.ini: infact, one for IIS7 is in the php
>directory, the other, for apche, is now it the latter conf directory.
>
>Do you think I can find a problem with 2 php.ini files loaded? The
>only difference between the 2 files is the doc_directory pointed.

You now have two instances of PHP loaded, each with its
own php.ini, one in the Apache process, and one in the IIS
process. They are completely separate instances, there
will be no mutual interference, so no problem there.

But you have to maintain both, which is extra work.
If both php.ini are exactly the same, you could point
Apache to the one IIS uses (or the other way around).
Both processes will only read php.ini, so concurrent
access shouldn't be a problem.
--
( Kees
)
c[_] Linux on the desktop has been a year or two away for
over a decade now. (Eric Steven Raymond and Rob Landley
in "World Domination 201") (#481)

Re: Apache and soap

am 09.01.2008 16:58:11 von marcomangiante

Hello,

> If both php.ini are exactly the same, you could point
> Apache to the one IIS uses (or the other way around).
> Both processes =A0will only read php.ini, so concurrent
> access shouldn't be a problem.

the only difference in the 2 files is where the doc_root points: while
for apache it points to C:\Program Files\Apache Software Foundation
\Apache2.2\htdocs, for IIS 7 it points to C:\inetpub\wwwroot, so maybe
it is better to have one..sincerely I don't know.

--
Regards,

Marco Mangiante

Re: Apache and soap

am 09.01.2008 18:55:16 von Kees Nuyt

On Wed, 9 Jan 2008 07:58:11 -0800 (PST), marcomangiante
wrote:

>Hello,
>
>> If both php.ini are exactly the same, you could point
>> Apache to the one IIS uses (or the other way around).
>> Both processes  will only read php.ini, so concurrent
>> access shouldn't be a problem.
>
>the only difference in the 2 files is where the doc_root points: while
>for apache it points to C:\Program Files\Apache Software Foundation
>\Apache2.2\htdocs, for IIS 7 it points to C:\inetpub\wwwroot, so maybe
>it is better to have one..sincerely I don't know.

Hm, the document root is defined in the Apache
configuration file, httpd.conf. Don't know about IIS.
I don't think there is a docuemntroot defined in php.ini.

The only paths I have in php.ini are for
include_path, error_log, extension_dir, upload_tmp_dir,
sendmail_path, browscap, session.save_path,
soap.wsdl_cache_dir, mime_magic.magicfile,
zend_extension_ts and zend_extension_manager.optimizer_ts

Some of those may cause a conflict between the two php
instances (like error_log and session.save_path), so it
might be a better idea to have two php.ini files after
all.

HTH
--
( Kees
)
c[_] The future is here already. It's just unevenly
distributed. (William Gibson) (#189)