Re: [PHP] PHP 5 file_get_contents() problems

2008-04-01 Thread Richard Lynch


On Sun, March 30, 2008 5:03 pm, php wrote:
 Thanks Greg...I am aware of the allow_url_fopen/allow_url_include
 relationship.

 Your suggestion to look into curl was implemented and there still
 seems to
 be something else afoot.

 I created a simple set of curl functions which just printed a remote
 url to
 the browser window. This tested well on an alternate test site which
 has PHP
 5 running.

 However back on the hosting client I'm having problems with, curl
 throws the
 following error message:
 CURLE_COULDNT_RESOLVE_HOST (6)

 Couldn't resolve host. The given remote host was not resolved.

 A second test script, uses the popular PayPal Instant Payment
 Notification
 scheme which opens up a socket connection with the paypal server. Even
 this
 method of remote communition was defeated.

 So I'm lead to believe there is some other PHP configuration (or
 server
 configuration) which is stopping PHP from connecting with remove
 services.

Can you SSH into the box and ping other domain names?

If that box has messed up DNS, there is NO WAY php can fix it...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5 file_get_contents() problems

2008-03-31 Thread Daniel Brown
On Sun, Mar 30, 2008 at 6:03 PM, php [EMAIL PROTECTED] wrote:
 Thanks Greg...I am aware of the allow_url_fopen/allow_url_include
  relationship.

  Your suggestion to look into curl was implemented and there still seems to
  be something else afoot.

  I created a simple set of curl functions which just printed a remote url to
  the browser window. This tested well on an alternate test site which has PHP
  5 running.

  However back on the hosting client I'm having problems with, curl throws the
  following error message:
  CURLE_COULDNT_RESOLVE_HOST (6)

  Couldn't resolve host. The given remote host was not resolved.

That's a DNS issue, not a PHP issue.  Is this a shared web host,
or one for which you have root access?  If you have at least shell
access without a jail (chroot), try PING'ing the domain from the
server and see what happens.  It could even be something as simple as
a typo in the domain, but most likely it's a DNS resolution problem.

If you want to test your script on a different server, let me know
and I'll set you up with a temporary account on one of mine.

-- 
/Daniel P. Brown
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5 file_get_contents() problems

2008-03-30 Thread php
Thanks Greg...I am aware of the allow_url_fopen/allow_url_include 
relationship.

Your suggestion to look into curl was implemented and there still seems to 
be something else afoot.

I created a simple set of curl functions which just printed a remote url to 
the browser window. This tested well on an alternate test site which has PHP 
5 running.

However back on the hosting client I'm having problems with, curl throws the 
following error message:
CURLE_COULDNT_RESOLVE_HOST (6)

Couldn't resolve host. The given remote host was not resolved.

A second test script, uses the popular PayPal Instant Payment Notification 
scheme which opens up a socket connection with the paypal server. Even this 
method of remote communition was defeated.

So I'm lead to believe there is some other PHP configuration (or server 
configuration) which is stopping PHP from connecting with remove services.

Chris



Greg Bowser [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 The actual setting is allow_url_fopen.  allow_url_include controls whether
 or not you can use a remote URL as an include (however, if allow_url_fopen
 is off, then allow_url_include will also be off.)

 The short answer to your question is: yes, there is a way. Several ways, 
 in
 fact. You could use curl, or you could use an Http client written in php.
 The latter involves using either the socket_ or the fsocket functions.


 * http://scripts.incutio.com/httpclient/

 On Tue, Mar 18, 2008 at 10:11 AM, Chris [EMAIL PROTECTED] wrote:

 I've encountered a situation where under PHP 5 the file_get_contents()
 function will not work properly (actually not at all) if the php.ini
 Filesystem configuration parameter, allow_url_include is set to OFF.
 According to the PHP documentation allow_url_include is intended to
 limiting PHP from accessing scripts on other servers.

 I have read posts that suggest setting allow_url_include to ON as
 a solution. Well that's great if you have the ability to modify your
 php.ini. But what if you have an account on a shared hosting system
 and the hosting company will NOT make the requested change?

 Is there a work around to this or how would one access remote web 
 services
 if allow_url_include is OFF. This looks like a huge problem since many
 services, like PayPal's IPN and Google maps geocoding, rely on
 communication
 with their servers.

 Thanks,
 Chris



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP 5 file_get_contents() problems

2008-03-18 Thread Chris
I've encountered a situation where under PHP 5 the file_get_contents()
function will not work properly (actually not at all) if the php.ini
Filesystem configuration parameter, allow_url_include is set to OFF.
According to the PHP documentation allow_url_include is intended to
limiting PHP from accessing scripts on other servers.

I have read posts that suggest setting allow_url_include to ON as
a solution. Well that's great if you have the ability to modify your
php.ini. But what if you have an account on a shared hosting system
and the hosting company will NOT make the requested change?

Is there a work around to this or how would one access remote web services 
if allow_url_include is OFF. This looks like a huge problem since many 
services, like PayPal's IPN and Google maps geocoding, rely on communication 
with their servers.

Thanks,
Chris 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5 file_get_contents() problems

2008-03-18 Thread Greg Bowser
The actual setting is allow_url_fopen.  allow_url_include controls whether
or not you can use a remote URL as an include (however, if allow_url_fopen
is off, then allow_url_include will also be off.)

The short answer to your question is: yes, there is a way. Several ways, in
fact. You could use curl, or you could use an Http client written in php.
The latter involves using either the socket_ or the fsocket functions.


* http://scripts.incutio.com/httpclient/

On Tue, Mar 18, 2008 at 10:11 AM, Chris [EMAIL PROTECTED] wrote:

 I've encountered a situation where under PHP 5 the file_get_contents()
 function will not work properly (actually not at all) if the php.ini
 Filesystem configuration parameter, allow_url_include is set to OFF.
 According to the PHP documentation allow_url_include is intended to
 limiting PHP from accessing scripts on other servers.

 I have read posts that suggest setting allow_url_include to ON as
 a solution. Well that's great if you have the ability to modify your
 php.ini. But what if you have an account on a shared hosting system
 and the hosting company will NOT make the requested change?

 Is there a work around to this or how would one access remote web services
 if allow_url_include is OFF. This looks like a huge problem since many
 services, like PayPal's IPN and Google maps geocoding, rely on
 communication
 with their servers.

 Thanks,
 Chris



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP 5 file_get_contents() problems

2008-03-18 Thread Thijs Lensselink

Quoting Chris [EMAIL PROTECTED]:


I've encountered a situation where under PHP 5 the file_get_contents()
function will not work properly (actually not at all) if the php.ini
Filesystem configuration parameter, allow_url_include is set to OFF.
According to the PHP documentation allow_url_include is intended to
limiting PHP from accessing scripts on other servers.

I have read posts that suggest setting allow_url_include to ON as
a solution. Well that's great if you have the ability to modify your
php.ini. But what if you have an account on a shared hosting system
and the hosting company will NOT make the requested change?

Is there a work around to this or how would one access remote web services
if allow_url_include is OFF. This looks like a huge problem since many
services, like PayPal's IPN and Google maps geocoding, rely on communication
with their servers.



Try ini_set(allow_url_include, 1); In your script. (not tested)

If that doesn't help. You can use CURL for this :  
http://php.net/manual/en/ref.curl.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5 file_get_contents() problems

2008-03-18 Thread Greg Bowser
for security reasons, allow_url_include can only be set from the main
php.ini

On Tue, Mar 18, 2008 at 10:22 AM, Thijs Lensselink [EMAIL PROTECTED] wrote:

 Quoting Chris [EMAIL PROTECTED]:

  I've encountered a situation where under PHP 5 the file_get_contents()
  function will not work properly (actually not at all) if the php.ini
  Filesystem configuration parameter, allow_url_include is set to OFF.
  According to the PHP documentation allow_url_include is intended to
  limiting PHP from accessing scripts on other servers.
 
  I have read posts that suggest setting allow_url_include to ON as
  a solution. Well that's great if you have the ability to modify your
  php.ini. But what if you have an account on a shared hosting system
  and the hosting company will NOT make the requested change?
 
  Is there a work around to this or how would one access remote web
 services
  if allow_url_include is OFF. This looks like a huge problem since many
  services, like PayPal's IPN and Google maps geocoding, rely on
 communication
  with their servers.
 

 Try ini_set(allow_url_include, 1); In your script. (not tested)

 If that doesn't help. You can use CURL for this :
 http://php.net/manual/en/ref.curl.php


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP 5 file_get_contents() problems

2008-03-18 Thread Thijs Lensselink

Quoting Greg Bowser [EMAIL PROTECTED]:


for security reasons, allow_url_include can only be set from the main
php.ini



I wasn't sure about that one. Thanks for the correction.


On Tue, Mar 18, 2008 at 10:22 AM, Thijs Lensselink [EMAIL PROTECTED] wrote:


Quoting Chris [EMAIL PROTECTED]:

 I've encountered a situation where under PHP 5 the file_get_contents()
 function will not work properly (actually not at all) if the php.ini
 Filesystem configuration parameter, allow_url_include is set to OFF.
 According to the PHP documentation allow_url_include is intended to
 limiting PHP from accessing scripts on other servers.

 I have read posts that suggest setting allow_url_include to ON as
 a solution. Well that's great if you have the ability to modify your
 php.ini. But what if you have an account on a shared hosting system
 and the hosting company will NOT make the requested change?

 Is there a work around to this or how would one access remote web
services
 if allow_url_include is OFF. This looks like a huge problem since many
 services, like PayPal's IPN and Google maps geocoding, rely on
communication
 with their servers.


Try ini_set(allow_url_include, 1); In your script. (not tested)

If that doesn't help. You can use CURL for this :
http://php.net/manual/en/ref.curl.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php