Menu

problem with PHP 5.0

Help
2005-07-12
2013-04-29
  • Nobody/Anonymous

    Since our host have upgraded the PHP Core to the last version (5.0.4) the add_torrent function doesn't work at all.
    This is the error message:

    Warning: fopen(): open_basedir restriction in effect. File(/var/tmp/phpe3tx18) is not within the allowed path(s): (/usr/home/quasiper/:/usr/lib/php:/usr/local/lib/php:/tmp) in /usr/home/quasiper/public_html/nta/administration/bta_add.php on line 125

    Warning: fopen(/var/tmp/phpe3tx18): failed to open stream: Operation not permitted in /usr/home/quasiper/public_html/nta/administration/bta_add.php on line 125
    File upload error 1

    Is there a way for solve this problem or I must wait a new version of PhpTrackerPlus (or an help from the host's staff)?

    Thanks.

     
    • Dan

      Dan - 2005-07-13

      This isn't really a problem with PHP 5. They have restricted rights to the tmp folder. There might be a workaround for this, but you would need to have shell access to create a directory in your space (i.e. /usr/home/quasiper/tmp).

      Usually on hosts your docs are in /usr/home/<id>/htdocs so you should be safe.

      If you do have this type of access we can change the add script slightly and it should work.

       
    • Nobody/Anonymous

      I think you're right. I simply made a change in configuration settings or I need to modify the script?

       
    • Dan

      Dan - 2005-07-15

      Create the directory and make sure it's writable, then add this line below the session_start() line in bta_add.php:

      ini_set("upload_tmp_dir", "/usr/home/quasiper/tmp");

      and it should be OK.

       
    • Nobody/Anonymous

      Hmm... it doesn't work but I'm not sure to have done it properly.

      I've added the code line here:

      session_start();
          ini_set("upload_tmp_dir", "(/usr/home/quasiper/:/usr/lib/php:/usr/local/lib/php:/tmp");
          header("Cache-control: private");

          /*
           * List of the external modules required
           */
          require_once ("../config.php");
                      ....
                      ....

      Then I've created a directory called "upload_tmp_dir" under the folder "administration" but it shows the same error.

       
    • Nobody/Anonymous

      PS: I've tried also with:

      ini_set("upload_tmp_dir", "/usr/home/quasiper/tmp");

      but this is the result:

      Warning: fopen(): open_basedir restriction in effect. File(/var/tmp/phpyyOe7G) is not within the allowed path(s): (/usr/home/quasiper/:/usr/lib/php:/usr/local/lib/php:/tmp) in /usr/home/quasiper/public_html/nta/administration/bta_add.php on line 126

      Warning: fopen(/var/tmp/phpyyOe7G): failed to open stream: Operation not permitted in /usr/home/quasiper/public_html/nta/administration/bta_add.php on line 126
      File upload error 1

       
    • Dan

      Dan - 2005-07-18

      I looked into this a little more and found out scripts can't change the upload directory unless they explicitly give you permission to read the directory.

      I would check into the ISP to see if you are allowed to use PHP to handle file uploads. They need to explicitly allow you to use it the way it is configured now.

      It seems that they have not specified the /tmp directory in the configuration, they may have intended on using it for file uploads - I can see you do have permission to read there. Is it possible that they forgot to change the upload directory?

       
    • Nobody/Anonymous

      I know that they've some problems after the installation of PHP 5.0 so it's possibile that they haven't specify a directory yet.
      A week ago I've sent a mail to the support and they told me that they're working on it. A week passed and it's always the same so I've believed that was a tracker's problem.
      I will recontact the host's staff.

      Thanks a lot for your help.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.