http steams not working?

  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

Hi guys,

I have been breaking my head over this, so i was hoping you guys could possibly hint me in the right direction.

Oke, the symptom is the following. I wrote a little script that uses the SOAP client to load an WSDL from a public webservice which works perfectly on windows. Now the idea was to port it to linux so I installed httpd from the RPMs provided with the media, and compiled the latest stable version of PHP.

On the linux box, when ever PHP is trying to open an http stream i`ll get an error that it is not able to with errors like 'failed to open stream: HTTP request failed'. I tried using curl, fopen, SoapClient, all result in simular errors.

On the linux shell, when i call wget {URL} it results in the remote content being downloaded, so network and name resolution are working like a bliss.

When i verify the php.ini using phpinfo() it confirms that the following streams are registered.. Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar

The allow_url_fopen is On & On
PHP user_agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

verified that the linux firewall is disabled, and SE is allowing httpd network connections.

Compiled both the stable PHP release and latest build (running now) which makes no difference.

HELP! what am i missing here?

Im still not able to open any http stream from PHP... :(
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

some error messages (maybe they help)
[Thu Jul 21 22:23:18 2011] [error] [client 10.251.251.100] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL' : failed to load external entity "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL"\n in /var/www/html/index.php on line 12

[Thu Jul 21 22:21:18 2011] [error] [client 10.251.251.100] PHP Warning: fopen(http://webservices.oorsprong.org/websam ... e.wso?WSDL) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: HTTP request failed! in /var/www/html/index.php on line 9

On the same box..

[root@ovamisux201 httpd]# wget http://webservices.oorsprong.org/websam ... e.wso?WSDL
--2011-07-21 23:49:53-- http://webservices.oorsprong.org/websam ... e.wso?WSDL
Resolving webservices.oorsprong.org... 62.177.194.231
Connecting to webservices.oorsprong.org|62.177.194.231|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31254 (31K) [text/xml]
Saving to: `CountryInfoService.wso?WSDL'

100%[=====================================================================>] 31,254 --.-K/s in 0.1s

2011-07-21 23:49:54 (216 KB/s) - `CountryInfoService.wso?WSDL' saved [31254/31254]
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

This looks like either your server isn't configured right or you have a firewall getting in your way - Sonicwall is known for this. If this is you, disable "Enforce Host Tag Search for CFS" under "Internal Settings".

What distro are you using? You mention you installed apache from RPMs but compiled PHP. Why didn't you install PHP from RPMs as well?

It's generally a bad idea to install packages from source on an RPM-based distro because you end up breaking things. If you must recompile packages for these systems, the proper method is to create an RPM of your package and install from that so it gets properly registered with the system.

As an aside: This should be moved to the *nix forum.
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

Might be a nix issue indeed, sorry for that.

I compiled PHP from source because Oracle Enterprise Linux doesnt provide the --enable-soap option, and in this case we need the SoapClient class to be available.

During compile we did use the complile options provided by a RPM installed PHP environment from a equal Oracle Enterprise Linux distro.

We are aware of the issues this approach might have, but its the only way of getting the soapclient available. Problem is that the specification file provided isnt working on this distro without allot of work and tweaking and we where looking for an easy approach. Now we are switching to Ubuntu server, and have a look with that distro :)

We dont use the CFS option for this exact reason ^^ being an Oracle Development Company and all :)
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

there should be a php53-soap or a php-soap rpm available for OEL.
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

You are right (:/) overlooked it the first time

http://oss.oracle.com/projects/php/files/EL5/x86_64/

thx
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

I can't say I've never done similar

If that doesn't fix your issue, post back. Don't forget to restart apache after you've installed the RPM.
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

Shamefully it still doesnt work on a different installation, same error. :/

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL' : failed to load external entity "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL"

hm...
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

The annoying part is that no error logging is returned anywhere. The same works like a bliss on my windows environment. :S

Well, ill keep on experimenting :)
Im installing Ubuntu Server as a LAMP, so lets see what that one will do :)
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

This is absurd

Content filtering wasnt configured, at least no 'policy' was defined. But on the zones page it was still enabled.

removing the CFS from the zone configuration resolved this problem. Weird thing is that PHP running under Windows doesnt seem to be affected by this..

:s

Great hint on the CFS...

Ow well it works :/
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

phew, had me scratching my head.

I should have mentioned that it's enabled by default :P
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

Well it doesnt make any sense on why it only seems to block requests made by linux, whereas it simple accepts the requests made by a WAMP environment thats located in the same zone..

Well its working non the less :)
http://213.154.233.137/cws.php?i=nl

Thx again for your help.

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 59 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.