+ Reply to Thread
Results 1 to 7 of 7

Thread: Warning: system() has been disabled...

  1. #1
    albNio's Avatar
    albNio is offline x10Hosting Member albNio is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    4

    Warning: system() has been disabled...

    Hello,
    I have installed a website to help me in a game called travian, i have installed the trooptool,
    http://laffers.net/works/trooptool.php
    but after the installation, when i try to update some database (i don't know aboute php code) i get this message:

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

    can anywone help me please..

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

    Re: Warning: system() has been disabled...

    Why do you need a system() call? anyways, you should have searched the forum as there was a post related to this http://forums.x10hosting.com/program...tml#post549760 http://forums.x10hosting.com/free-ho...tml#post548371 http://forums.x10hosting.com/news-an...6-14-09-a.html
    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

  3. #3
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: Warning: system() has been disabled...

    Quote Originally Posted by xav0989 View Post
    Why do you need a system() call? anyways, you should have searched the forum as there was a post related to this http://forums.x10hosting.com/program...tml#post549760 http://forums.x10hosting.com/free-ho...tml#post548371 http://forums.x10hosting.com/news-an...6-14-09-a.html
    His particular error's not mentioned in any of those topics, but I've got a reasonable suspicion as to why it's erroring.

    system — Execute an external program and display the output
    That's what the code's supposed to do, so somewhere it's cheating and just running another app to get the results of SOMETHING to display.




    However, the chances of being able to run that on x10free is virtually 0% - Exec and Shell_Exec do similar actions and are disabled for security reasons as well, and have been for some time - it's been used too many times by people trying to abuse the service, plus it's about as big a security hole as posting the administrator username/password.


    I'd look at installing a local testing server like WAMP or XAMPP and install trooptool on there instead - local testing servers shouldn't have any restrictions, and you should be able to use the tool you wanted without having to modify it much (if at all).


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  4. #4
    albNio's Avatar
    albNio is offline x10Hosting Member albNio is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    4

    Re: Warning: system() has been disabled...

    Quote Originally Posted by Livewire View Post
    I'd look at installing a local testing server like WAMP or XAMPP and install trooptool on there instead - local testing servers shouldn't have any restrictions, and you should be able to use the tool you wanted without having to modify it much (if at all).
    the tool works good but the only problem i have is that i can't update the database... i mean i can't update the map of the game on my troop tool site.. so i have luck of information like names of vilages players population etc...
    Last edited by albNio; 06-16-2009 at 03:58 PM. Reason: Automerged Doublepost

  5. #5
    albNio's Avatar
    albNio is offline x10Hosting Member albNio is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    4

    Re: Warning: system() has been disabled...

    do you know any way to enable system() or to update my database manually?

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Warning: system() has been disabled...

    system() will never be enabled. Don't even try.

    You can do it manually by downloading http://s4.travian.gr/map.sql and using phpMyAdmin (accessible from cPanel) to execute it. You could also rewrite the updater to not use command line tools. PHP can readily fetch a file using PHP and execute SQL queries. Just be sure you trust the source file or validate it.

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

    Re: Warning: system() has been disabled...

    Hi there,

    I'm having the exact same issue as stated above... for the exact same tool, lol.
    However I manually read the map.sql through phpMyAdmin and am now looking for a way to use the "update.php" as above, however finding a different method. i.e. no system()...

    However I am clueless when it comes to PHP, and I dont exactly have the luxury of time to go learn PHP from basic principals.

    Is anyone able to suggest a script or some code that will perform the following functions without using system?

    Thanks in advance!

    -David

    // 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');


    // Check whether the file has been downloaded and is larger than zero bytes
    if (file_exists('data/tmp.sql') AND filesize('data/tmp.sql')) {

    // Empty table
    $query = 'TRUNCATE TABLE x_world';
    $result = @mysql_query($query) OR die('Can not clear table '.PREFIX.'world!');

    if(system($mysql_executable.' --host='.$mysqlhost.' --user='.$mysqluser.' --password='.$mysqlpass.' --default-character-set=utf8 '.$mysqldb.' < data/tmp.sql') === false) {
    echo 'Update failed!';
    } else {
    echo 'Update was successful!';
    }

+ Reply to Thread

Similar Threads

  1. Replies: 14
    Last Post: 09-29-2008, 07:07 PM
  2. It works! ...
    By bpakidz in forum Programming Help
    Replies: 4
    Last Post: 09-07-2008, 11:12 PM
  3. New Site-Suggestions?
    By mnoutside in forum Review My Site
    Replies: 9
    Last Post: 08-27-2008, 07:01 AM
  4. GeIP Script Help
    By cybahq in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 07-30-2008, 06:19 AM
  5. GeIP Script Help
    By cybahq in forum Free Hosting
    Replies: 4
    Last Post: 07-30-2008, 05:08 AM

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