+ Reply to Thread
Results 1 to 4 of 4

Thread: problems with system()

  1. #1
    roelmb is offline x10Hosting Member roelmb is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    4

    problems with system()

    I'm getting this error


    Warning: system() has been disabled for security reasons in /home/roelmb/public_html/ps-troepentool2/updater.php on line 20
    Failed downloading http://s6.travian.nl/map.sql or the file could not be saved due to file system permission restrictions!

    Code:
     // load the map.sql via system command using "wget" into the folder data/
     // IMPORTANT: PHP has to be allowed to write into that folder, if necessary set the needed rights! 
     system('wget '.$travian_db_dump.' -O data/tmp.sql');
    Is their a solution for this problem. I already put the permission on the folder too writing is their something else I need to do


    Is it possible to download the file with cron
    Last edited by roelmb; 09-30-2009 at 08:00 AM.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: problems with system()

    PHP's cURL library....

    PHP Code:

    $ch 
    curl_init("http://s6.travian.nl/map.sql");

    // assuming data is a subdirectory of the directory where script is located...

    $fp fopen("data/tmp.sql""w");  

    curl_setopt($chCURLOPT_FILE$fp);

    curl_setopt($chCURLOPT_HEADER0);

    curl_exec($ch);

    curl_close($ch);

    fclose($fp); 
    PHP Manual section on cURL
    Last edited by descalzo; 09-30-2009 at 10:33 AM.
    Nothing is always absolutely so.

  3. #3
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: problems with system()

    The answer is in the warning. In a shared hosting, the system function poses a security risk to the servers, therefore it is disabled. There is no solution except to use another method, such as the cURL library as descalzo suggested (if that works I have not tested myself).

  4. #4
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: problems with system()

    Dokuwiki uses sockets (if I remember well) and works on x10.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

+ Reply to Thread

Similar Threads

  1. Backend System Issues
    By Bryon in forum Service Alerts
    Replies: 1
    Last Post: 06-25-2009, 04:32 PM
  2. Perception System Requires iPhone Developer
    By perceptwilli in forum Computers & Technology
    Replies: 0
    Last Post: 01-16-2009, 11:31 PM
  3. CPU Usage always 75% to 100%
    By cased in forum Computers & Technology
    Replies: 29
    Last Post: 11-08-2008, 01:16 PM
  4. How to Over-clock a CPU [ tutorial ]
    By elpvn in forum Computers & Technology
    Replies: 4
    Last Post: 09-16-2006, 10:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers