Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Unable to write to /tmp

Discussion in 'General Discussion' started by epaslv, Feb 23, 2017.

Tags:
  1. epaslv

    epaslv Member

    Joined:
    May 18, 2010
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Something strange hwe just noticed with all our servers running WordPress. All the updates fail with

    Update Failed: The package could not be installed. PCLZIP_ERR_MISSING_FILE (-4) : Missing archive file '/tmp/akismet.3.3-lYll1n.tmp'

    It appears that PHP is unable to write to /tmp which

    I have created another folder and have changed the global sys_temp_dir which resolves the problem. Is there any reason why the default, /tmp would not work?

    We are using the ea-php70 profile with PHP-FPM as per

    We are running CENTOS 7.3 x86_64 kvm – phil WHM 62.0 (build 15) with the following in EA4

    Apache 2.4
    config
    config-runtime
    mod_bwlimited
    mod_cgi
    mod_deflate
    mod_expires
    mod_headers
    mod_mpm_prefork
    mod_proxy
    mod_proxy_fcgi
    mod_proxy_http
    mod_ruid2
    mod_security2
    mod_ssl
    mod_unique_id
    tools

    PHP 7.0
    libc-client
    pear
    php-bcmath
    php-bz2
    php-calendar
    php-cli
    php-common
    php-curl
    php-devel
    php-fpm
    php-ftp
    php-gd
    php-iconv
    php-imap
    php-litespeed
    php-mbstring
    php-mcrypt
    php-mysqlnd
    php-pdo
    php-posix
    php-soap
    php-sockets
    php-xml
    php-zip
    runtime

    Others
    apr
    apr-util
    cpanel-tools
    documentroot
    libmcrypt
    modsec-sdbm-util
    php-cli
    php-cli-lsphp
    profiles-cpanel

    Below are the settings for /tmp

    drwxrwxrwt 10 root root 425984 Feb 24 13:41 tmp
    drwxrwxrwt 10 root root 4096 Feb 24 13:42 tmp

    /dev/vda1 61795324 11213140 48046060 19% /
    devtmpfs 4083476 0 4083476 0% /dev
    tmpfs 4088124 0 4088124 0% /dev/shm
    tmpfs 4088124 16808 4071316 1% /run
    tmpfs 4088124 0 4088124 0% /sys/fs/cgroup
    tmpfs 817628 0 817628 0% /run/user/0
    tmpfs 817628 0 817628 0% /run/user/99

    Running Kernels

    3.10.0-229.1.2.el7.x86_64
    3.10.0-514.6.2.el7.x86_64
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,492
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Please post the output from the following commands:

    Code:
    stat /tmp
    mount|grep tmp
    Also, while there are no changes in cPanel version 62, do note the following changes to the PHP session.save_path in cPanel version 64:

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. epaslv

    epaslv Member

    Joined:
    May 18, 2010
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Hi

    Thanks for looking into this. Stat for /tmp is as per below

    [root@bobby home]# stat /tmp
    File: '/tmp'
    Size: 425984 Blocks: 840 IO Block: 4096 directory
    Device: fd01h/64769d Inode: 393230 Links: 9
    Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2017-02-28 03:19:38.263000000 +1100
    Modify: 2017-02-28 13:49:04.406000000 +1100
    Change: 2017-02-28 13:49:04.406000000 +1100
    Birth: -

    mount|grep tmp

    /dev/vda1 on /var/tmp type ext4 (rw,relatime,errors=remount-ro,data=ordered,jqfmt=vfsv0,usrjquota=quota.user)

    The session.save_path is not set, or NULL, so I assume it defaults to /tmp

    I have set the sys_temp_dir globally to /var/tmp which resolves the issue, stat for /var/tmp/ is below

    [root@bobby public_html]# stat /var/tmp/
    File: '/var/tmp/'
    Size: 425984 Blocks: 840 IO Block: 4096 directory
    Device: fd01h/64769d Inode: 393230 Links: 9
    Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2017-02-28 14:12:40.644000000 +1100
    Modify: 2017-02-28 14:16:53.248000000 +1100
    Change: 2017-02-28 14:16:53.248000000 +1100
    Birth: -



     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,492
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. RWH Tech

    RWH Tech Well-Known Member

    Joined:
    Oct 1, 2015
    Messages:
    86
    Likes Received:
    16
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hey guys, the same issue just cropped up here when I tried to update WP after the 64 upgrade. What's the fix?
    EDIT: Moving from FPM to CGI fixed it. Good thing I only have test sites on FPM.
     
    #5 RWH Tech, Apr 4, 2017
    Last edited: Apr 4, 2017
  6. epaslv

    epaslv Member

    Joined:
    May 18, 2010
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    I am using FPM, the fix for me was to update php.ini to

    sys_temp_dir = "/var/tmp"

    But I am not sure if this is as secure
     
  7. vacancy

    vacancy Well-Known Member

    Joined:
    Sep 20, 2012
    Messages:
    221
    Likes Received:
    28
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    I have a similar problem.

    A shopping script is taking our products from another site with a bot in xml. The bot does not work when php-fpm is active, so I guess the same problem. The problem is solved when php-fpm is turned off and suphp is run.

    I am using php 5.6.
     
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,492
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Could you provide some more information about the affected systems? EX:

    Code:
    cat /usr/local/cpanel/version
    cat /etc/redhat-release
    Also, try running the following test PHP script on one of the websites using PHP-FPM to see if it loads:

    Code:
    <?php
    session_start();
    phpinfo();
    ?>
    If so, let us know what you see for the "session.save_path" value on the PHPINFO output.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. vacancy

    vacancy Well-Known Member

    Joined:
    Sep 20, 2012
    Messages:
    221
    Likes Received:
    28
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    Centos 6.8 64 bit
    Cpanel 11.62 build 17
     
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,492
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Could you upload the test file referenced in my last response and let us know what you see for the "session.save_path" value in the PHPINFO output. I'm unable to reproduce this issue on a test system.

    Also, do you have any systems running cPanel version 64, and if so, can you reproduce the issue on those systems?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    373
    Likes Received:
    1
    Trophy Points:
    318
    And the fix was?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,492
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Can you describe the specific issue you are facing?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. XeonS

    XeonS Registered

    Joined:
    May 22, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Romania
    cPanel Access Level:
    Root Administrator
    The issue still persists on v68.0.19, a fix is to force rebuild the PHP-FPM conf with Migrate all accounts to PHP-FPM or edit php.ini for every PHP version and add upload_tmp_dir = /var/tmp which is not very safe. (be careful if you have open_basedir, you need to put :/var/tmp)

    The upload_tmp_dir should be /home/$user/tmp not the main /var/tmp, maybe guys from CPanel will think about this and look for more features on security, like disable_functions,open_basedir, session.savepath and upload_tmp_dir, all of these should be in every user folder, like a chroot environment.
     
  14. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,492
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi @XeonS,

    Do you happen to use Nginx on this system?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice