Koozali.org: home of the SME Server

Using php script to download content to an ibay

henrikmc

Using php script to download content to an ibay
« on: September 14, 2005, 11:06:11 AM »
Hi

Im having a problem with getting my script to work. It worked on my sme 5.6 but after moving to 6.0.1 its dosent anymore. I get this in my messages log:

Sep 14 10:57:01 hmcdata2 httpd: PHP Warning:  fopen("http://www.jpost.com/servlet/Satellite?pagename=JPost/P/Section/IndexList&cid=1078397702269", "r") - No such file or directory in /home/e-smith/files/ibays/knasbay/html/news/jerusalempost.php on line 91
Sep 14 10:57:01 hmcdata2 httpd: PHP Warning:  Supplied argument is not a valid File-Handle resource in /home/e-smith/files/ibays/knasbay/html/news/jerusalempost.php on line 93

Any body have a clue?

gardnc

Using php script to download content to an ibay
« Reply #1 on: September 14, 2005, 02:06:29 PM »
henrikmc,

What this is telling you in absolute terms is that the file:

http://www.jpost.com/servlet/Satellite?pagename=JPost/P/Section/IndexList&cid=1078397702269

can't be opened by your php program:

/home/e-smith/files/ibays/knasbay/html/news/jerusalempost.php

It may be because the file literally does not exist at that location, or that your sme server does not have permission to access it.  Both would result in that error.

I suggest you attempt to load the file in a browser window to see what happens.

Larry

henrikmc

Using php script to download content to an ibay
« Reply #2 on: September 14, 2005, 02:37:29 PM »
Quote from: "gardnc"
henrikmc,

What this is telling you in absolute terms is that the file:

http://www.jpost.com/servlet/Satellite?pagename=JPost/P/Section/IndexList&cid=1078397702269

can't be opened by your php program:

/home/e-smith/files/ibays/knasbay/html/news/jerusalempost.php

It may be because the file literally does not exist at that location, or that your sme server does not have permission to access it.  Both would result in that error.

I suggest you attempt to load the file in a browser window to see what happens.

Larry


Yes, I agree that is the case. But it it only a sympton as the url is all valid and the exact same installation runs from apache on my desktop pc with no errors at all. And it also ran from the 5.6 SME version. So I can only see its a SME, php, apache, security problem / configuration issue, and im out of ideas right now where to look for a solution. I can even lynx to the site within a console session so the site is not a problem.

Henrik

gardnc

Using php script to download content to an ibay
« Reply #3 on: September 14, 2005, 02:45:20 PM »
Well, the next step for me would be to take portions of the offending code and create a test php page to run in the command line with appropriate debugging to see where the error is being introduced.

Since this is really off topic to the sme formums, I'd be happy to continue this discussion by email: I'm at larry at tm-wd dot com.

Larry

henrikmc

Using php script to download content to an ibay
« Reply #4 on: September 14, 2005, 03:57:44 PM »
Quote from: "gardnc"

Since this is really off topic to the sme formums, I'd be happy to continue this discussion by email
Larry


Why is this off topic to SME? Its an error only applicable to my SME installation. Its not an error in the php script as you continue to imply.  :hammer:

gardnc

Using php script to download content to an ibay
« Reply #5 on: September 14, 2005, 06:58:26 PM »
Sorry, wasn't trying to hurt anyone's feelings over "off topic".  This is a php issue whether the php came on your sme or from somewhere else, and I felt it was better to discuss it other than in the sme forum - and still do.

Larry

gardnc

Using php script to download content to an ibay
« Reply #6 on: September 14, 2005, 07:16:48 PM »
You need to change the following directive in /etc/php.ini

change allow_url_fopen = Off

to

allow_url_fopen = On

Larry

henrikmc

Using php script to download content to an ibay
« Reply #7 on: September 14, 2005, 08:28:00 PM »
Quote from: "gardnc"
You need to change the following directive in /etc/php.ini

change allow_url_fopen = Off

to

allow_url_fopen = On

Larry


Lol, just did that before reading your post! but ofcource added a custom-template to change that, as editing /etc/php.ini directly would be overwritten on any update. /65FopenWrappers

SME is secure I believe in default installation.

Case closed.

Offline arne

  • *****
  • 1,116
  • +0/-4
Using php script to download content to an ibay
« Reply #8 on: September 14, 2005, 09:23:04 PM »
I think the question is a bit unclear as the heading indicate some problems with some php upload (??) while the remaining text is taliking about some external link to a news magazine.

If this should be a question about a php file upload that does not work, this would eventually be a very well known problem.

The sme 5.6 and 6.0.1 contains a php croot environment (for security reasons) that "normally" will prevent a php file upload. This can eventually be resat on some cost of server security. (Most Linux servers does not contain such a php chrooted environment.)
......