Back to blog

How to fix phpMyAdmin mkdir permission denied with owner and open_basedir diagnostics

2/24/2025 · 1 min · HestiaCP

Share

mkdir(): Permission denied in phpMyAdmin is usually a runtime filesystem policy issue, not just a chmod issue.

Diagnose

ps aux | grep php-fpm
php -i | grep -E 'upload_tmp_dir|sys_temp_dir|open_basedir'
ls -ld /tmp
ls -ld /var/lib/php/sessions

Fix

chown -R www-data:www-data /var/lib/php/sessions
chmod 1733 /var/lib/php/sessions

If needed, extend open_basedir to include the temp/session path and restart PHP-FPM.

Validate

Final takeaway

The right fix is runtime alignment: executing user, writable temp path, and allowed path policy.

CC BY-NC

This post is licensed under CC BY-NC.

Comments

Join the discussion below.