Applicable to:
- Plesk for Linux
Symptoms
-
Unable to update PrestaShop content or upload pictures:
CONFIG_TEXT: 500 - Internal Server Error
-
Following error is shown in
/var/www/vhosts/system/example.com/logs/error_log
file:CONFIG_TEXT: mod_fcgid: stderr: PHP Warning:
file_put_contents(/var/www/vhosts/example.com/httpdocs/modules/gamification/data/data_ES_EUR_ES.json):
failed to open stream: Permission denied in
/var/www/vhosts/example.com/httpdocs/modules/gamification/gamification.php
on line 335, referer:
http://example.com/admin/index.php?controller=AdminCmsContent&id_cms=4&conf=4&updatecms&token=0&url_preview=1
Cause
Incorrect permissions for website files/directories:
# ls -lha /var/www/vhosts/example.com/httpdocs/modules/ | grep gamification
drwxr-xr-x. 8 apache apache 4,0K ago 24 2017 gamification
Resolution
-
Get subscription username changing
Domain
variable with affected domain name:# domain='example.com'; plesk db "select domains.name as 'Domain', sys_users.login as 'Username' from domains, hosting, sys_users where domains.id = hosting.dom_id and hosting.sys_user_id = sys_users.id and domains.name = '$domain'"
+-------------+---------------+
| Domain | Username |
+-------------+---------------+
| example.com | suexampleuser |
+-------------+---------------+ -
Fix permissions manually changing
suexampleuser
with the username of the subscription got in previous step:# find /var/www/vhosts/example.com/httpdocs/ -type f -exec chmod 644 {} \;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chmod 755 {} \;
# chown -R suexampleuser:psacln /var/www/vhosts/example.com/httpdocs/*
Comments
0 comments
Please sign in to leave a comment.