I’d like to get some data from some Bureau of Reclamation servers to plot with my data. The BOR IT guys have been helpful and showed me how to construct urls to access the data from their old flat files on a VMS system. I thought I could use the screen scraping technique show by Welling and Thompson in “PHP and MySQL Web Development” page 359, but when I tried the book’s script on DH I got

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/.edison/ykfpdata/ on line 17

Does this mean file_get_contents is disabled on DHs PHP?

This signature line intentionally blank.

By using the forum search correctly this time, I was able to find many solutions to this problem, particularly provided by Simon Jessy, 4/28/06

This signature line intentionally blank.

Just in case it wasn’t clear in those articles, you can use file_get_contents() on DH servers–just not on a remote URL. It still works fine on your own local files if you ever have a need for it.

:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.

Excuse publishes this post in a new subject, but I believe that it goes here

I want to install componete to eWeather, and can install all good, but when publishing it in my page Web it sends the following message to me:

under the file, and I look for line 1645 and I have the following code:

I have seen the information that published in Wiki DreamHost, in
following articles:

but I do not understand very well that to do in my page so that it

Can you help me?

Change this:

if ($this->httpConnection != null) { $response =& $this->httpConnection->get($filename); $this->httpConnection->disconnect(); return $response->getResponse(); } else if (function_exists('file_get_contents')) { //if (file_exists($filename)) { return file_get_contents($filename); //} } else { require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php'); $fileContents =& php_file_utilities::getDataFromFile($filename, 'r'); return $fileContents; }to this:

if ($this->httpConnection != null) { $response =& $this->httpConnection->get($filename); $this->httpConnection->disconnect(); return $response->getResponse(); } else if (file_exists($filename)) { $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $filename); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); return $file_contents; } else { require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php'); $fileContents =& php_file_utilities::getDataFromFile($filename, 'r'); return $fileContents; }

Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]

Thanks for the answer, I put the code that you mentioned, I do not mark any error, but it even follows without appearing to me the information in my page Web.

to check:

Some idea of because it does not work?

I’m not sure how I can be of any more help. I don’t have a clue what the script is supposed to do - I just replaced the existing file functions with their cURL alternative.

Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]

You will find the answer to how to modify eWeather for use on Dreamhost in this post from the Joomla! extensions site. Generally speaking, the Joomla! forums, and other sites Joomla! specific sites, will be your best best for Joomla! component related issues. :wink: . Good Luck!


Thank you very much… The component works correctly…

Thank´s rlparker and scjessey

You’re welcome, and I’m glad to hear you got it working properly! :slight_smile:


I thought I’d run my script that inserts the BOR data into the MySQL table as a cron job, but it doesn’t insert any lines in the table when run as from a command line, only when I call it with a browser. I’ve made the script executable, and it takes some time to get back to the command prompt. But no data is inserted. Is it the curl calls that need a browser environment|?

This signature line intentionally blank.