The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Your server does not support command line ZIP

Discussion in 'General Discussion' started by zestylemon, Jul 20, 2011.

  1. zestylemon

    zestylemon Member

    Joined:
    Jul 19, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    On one of my cPanel sites I'm running WordPress and have installed the BackupBuddy plugin. The plugin is throwing up the following alert message:

    Your server does not support command line ZIP. Backups will be performed in compatibility mode.

    The support comment for this alert is:
    If your server is configured to disable access to the PHP exec() function and if you have access to configure your server then remove any blocking of the PHP exec() function in php.ini and configure permissions to allow running the Linux command line function 'zip'.

    How do I go about making sure
    * the PHP exec() function is available for use
    * configure permissions for running 'zip'?
     
  2. fi77i

    fi77i Well-Known Member

    Joined:
    Aug 20, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Uruguay
    cPanel Access Level:
    Root Administrator
    Hello there, to check the disable functions for your site you can create an info.php file.

    Create a file called info.php in your public_html and add the following code in it.

    <?php
    phpinfo();
    ?>

    Then browse the file using your default browser (firefox,chrome,opera) and search for the disable_functions directive there.
    If exec() is disabled you can enable it for your site using a local php.ini, only if the server is using suPHP.

    Let me know for any further help.
     
  3. zestylemon

    zestylemon Member

    Joined:
    Jul 19, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the speedy reply. phpinfo.php shows the following:

    disable_functions no value no value
    safe_mode Off Off

    Safe mode is off so I'm not restricted. Am I correct to assume I then just enable it via php.ini? If the answer is "yes" then what should I add to php.ini?
     
  4. fi77i

    fi77i Well-Known Member

    Joined:
    Aug 20, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Uruguay
    cPanel Access Level:
    Root Administrator
    You can add the following line to your local php.ini in order to assure that there are no functions disabled

    disable_functions=

    And check the zip command perms, they should be as follows

    r2d2 / # which zip
    /usr/bin/zip
    r2d2 / # ls -la /usr/bin/zip
    -rwxr-xr-x 1 root root 181104 2010-05-09 14:58 /usr/bin/zip
     
  5. zestylemon

    zestylemon Member

    Joined:
    Jul 19, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    This appears to be the same as yours:

    root@host01 [/usr/bin]# ls -la /usr/bin/zip
    -rwxr-xr-x 1 root root 77280 Mar 11 2009 /usr/bin/zip*

    In /usr/local/lib/php.ini (which is my 'loaded configuration file according to phpinfo.php) I have the following line:
    disable_functions=

    A 'local php.ini' - should I create that in /home/username/
     
    #5 zestylemon, Jul 20, 2011
    Last edited: Jul 20, 2011
  6. fi77i

    fi77i Well-Known Member

    Joined:
    Aug 20, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Uruguay
    cPanel Access Level:
    Root Administrator
    A local php.ini is used only if you have suPHP working with apache.

    If your /usr/local/lib/php.ini shows no disabled functions and the perms are correct, everything should be working fine.

    Maybe the issue is another one, this is as far I can get without touching the server.

    Hope you can solve this issue.

    Regards.
     
  7. zestylemon

    zestylemon Member

    Joined:
    Jul 19, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I have a 2nd server so installed BackupBuddy on there and no problems are reported. I've started comparing the 2 phpinfo.php files and the first thing I've noticed is:

    Woks: /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
    Doesn't work: /sbin:/usr/sbin:/bin:/usr/bin

    /usr/local/bin & /usr/local/sbin is missing from the path. Where would I amend the path to add in the 2 that are missing?
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What option in phpinfo are you seeing this path noted?
     
  9. zestylemon

    zestylemon Member

    Joined:
    Jul 19, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    For the purpose of answering cPanelTristan's question...
    1 = the server it's not working on
    2 = the server it's working on

    'Apache environment' section
    1: PATH /sbin:/usr/sbin:/bin:/usr/bin
    2: PATH /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin

    'PHP Variables' section
    1: _SERVER["PATH"] /sbin:/usr/sbin:/bin:/usr/bin
    2: _SERVER["PATH"] /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Let's make it easier, since I'm not entirely certain how it pulls this information. Grab a copy of your existing /usr/local/lib/php.ini on the working machine, copy it over to the non-working machine as /usr/local/lib/php.ini.working and then run a diff on the two files:

    Code:
    diff /usr/local/lib/php.ini /usr/local/lib/php.ini.working
    This should show the setting differences then.

    Next, try to check if zip is compiled into PHP on both machines:

    Code:
    php -m | grep -i zip
     
  11. zestylemon

    zestylemon Member

    Joined:
    Jul 19, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I've done what you suggested. The diff generates quite a long document of 425 lines. I've figured out what < and > mean but further than that not sure what to look for.

    The results of running php -m | grep -i zip
    Works: PHP: syntax error, unexpected '=' in /usr/local/lib/php.ini on line 833
    Doesn't work: Nothing returned.

    I hope I've not uncovered a new issue... line 833 of php.ini on the working site is:
    url_rewriter.tags = a=href,area=href,frame=src,input=src,form=,fieldset=
     
  12. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    That is definitely an issue. Please check if you have 2 url_rewriter.tags lines. If you do not, then change that existing one to the following:

    Code:
    url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
    If you do have 2 url_rewriter.tags lines, then remove this one and use the one that is properly formatted with "" around it already.
     
Loading...

Share This Page