473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Fopen() wont work from crontab

Hi,

I have a script that calls an fopen() on an external URL.
I can run the script from the server as an url fine.
When however the script should be run from crontab, it does not work.
I get

Warning: fopen(): URL file-access is disabled in the server configuration
in [php-file]

Warning: fopen(http://[url].xml): failed to open stream: no suitable
wrapper could be found in [php-file] on line 66
I have set allow_url_fopen On, but it still wont work. Any Idea what could
cause that?

thanks

Oliver

Jul 17 '05 #1
3 6337
Oliver Spiesshofer wrote:
I can run the script from the server as an url fine.
When however the script should be run from crontab, it does not work.
I get

Warning: fopen(): URL file-access is disabled in the server configuration
in [php-file]

(snip)

On my system I have /two/ different php.ini files; one for apache and
the other for command-line.

apache: /etc/php4/apache/php.ini
cmd-line: /etc/php4/cgi/php.ini

On my system they both have "allow_url_fopen = On"

Try the command-line equivalent of phpinfo():

$ php -i | grep allow_url_fopen

HTH
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Just a shot in the dark, but what user is the cron running under? try
running the cron under same user as apache.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Oliver Spiesshofer" <ol****@email.com> wrote in message
news:Xn***************************@63.223.5.254...
Hi,

I have a script that calls an fopen() on an external URL.
I can run the script from the server as an url fine.
When however the script should be run from crontab, it does not work.
I get

Warning: fopen(): URL file-access is disabled in the server configuration
in [php-file]

Warning: fopen(http://[url].xml): failed to open stream: no suitable
wrapper could be found in [php-file] on line 66
I have set allow_url_fopen On, but it still wont work. Any Idea what could
cause that?

thanks

Oliver

Jul 17 '05 #3
thanks. this really helped me. I have two different also, which I did not
realize. I changed both and now it worked!

I am running gentoo linux. and the /etc/php directories contains two sub-
dirs, apache2-php4 and cli-php4 with each a php.ini

Oliver

Pedro Graca <he****@hotpop.com> wrote in
news:c0*************@ID-203069.news.uni-berlin.de:

On my system I have /two/ different php.ini files; one for apache and
the other for command-line.

apache: /etc/php4/apache/php.ini
cmd-line: /etc/php4/cgi/php.ini

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Catherine | last post by:
I am having a problem viewing asp pages on iis version 5.1 xp pro. HTML pages are viewable on http://localhost but .asp pages are not. I have created a test program called timetest.asp with the...
19
by: Allen Thompson | last post by:
sorry for the simple question, haven't done this in a while. when I use the following script it keeps displaying the value of "x" like a string. for example, if I type the number 7 in the prompt,...
0
by: Sebastian Sosna | last post by:
Hi there! iam trying a code snippet from MSDN heres the link : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/netds/creating_groups.asp ive tried the code but it...
7
by: Christine | last post by:
My code has a split function that should split the text file of numbers. I've run this in previous programs as it is here and it worked, but now it wont work for some reason and returns...
1
by: Gary | last post by:
I have the following in my web.config.... <customErrors mode="RemoteOnly" defaultRedirect="Applicationerror.aspx"/> but, my error page does not display. Instead a 'Runtime Error' page...
14
by: squash | last post by:
The following code works fine in Firefox/Netscape but wont work in IE. I suspect the problem is with one of these two simple functions. If there is no obvious error Ill paste the entire code. ...
8
by: Mark12345 | last post by:
Hi folks, thanks for looking. I have a database that takes down order details. Each customer has there own priceid in the price table. the errors that I get say enter parameter value for:...
2
by: jcollins1991 | last post by:
im trying to make a program thats supposed to check whether 2 strings are anagrams of each other (anagram = same letters in both strings, but in different orders... "cool as wet art" , and "cs at...
2
by: Admiral | last post by:
Hi, Anyone knows how this works? I have made a textbox called Editbox1 and 10 buttons. b0, b1, b2 etc. What i want to do is when i press a button, b1 for example, a number 1 appears into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.