Coverting to cURL

software development

#1

hi,
you know dreamhost don’t allow the fopen function I get this error.

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

when i get this error, i submit a message contact support, they says to me use cURL.

http://www.nonelife.com/import.txt
is my import script, but i don’t know how convert to the cURL?

thanks for help.
crawler


#2

This page has a lot of examples of using cURL. Given how the script you posted uses fopen(), the easiest thing for you will be to use cURL to retrieve the URL into the $data variable rather than freading it. The page I reference above does a better job of explaining and demonstrating the cURL options you have to set to do this better than I could.

Extra lifetime domain and $82 off with code [color=#CC0000]1DOM82[/color] or use [color=#CC0000]LM97[/color] for $97 off. Other Dreamhost coupon codes


#3

The DreamHost Wiki has information about using cURL instead of fopen() as well.

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL


#4

but i don’t know programming to php,cURL and other programming language.

if anyone know to cURL, please convert it.


#5

From looking at your script, it appears the “author/copyright” info was stripped. This makes it hard to google about and see if someone has already “patched” this code (why re-invent a wheel?).

Have you contacted the script author, or searched in venues relevant to that particular script to see if an undated/curlified version is available or if the author can do the curl conversion for the handling of file$ for you?

Just asking “if anyone know to cURL, please convert it”, seems a bit presumptive. :wink:

–rlparker


#6

Looks like this is the part that’s missing:

/------------------------------------------------------------------------/
// Product: PHP MELODY - MUSIC VIDEO CMS
// Version: 1.1
// Released: 14th OCTOBER 2007
// Copyright: © 2004-2007. All rights reserved.
/------------------------------------------------------------------------/

(Note that they don’t want that or the footer link removed.)

Anyway, it looks like they do offer a fix for Dreamhost.

You just have to contact their support staff with your order ID.


:stuck_out_tongue: Maximum savings promo code: MaxSavingsAtDH


#7

I think DH don’t allow fopen “by default”, but you can recompile your own version of php in your shell and set it to allow fopen.

http://www.linewbie.com


#8

“fopen” is not disabled at all, only “allow_url_fopen” and related functionality is disabled; you can use fopen just fine with local files under your control

Please, don’t enable allow_url_fopen. Compiling your own PHP5 is great if you know what you are doing; running PHP with allow_url_fopen on a shared server is “not so great”. DreamHost disables it in their installations for good reasons. :wink:

–rlparker