Run inkscape in PHP

大城市里の小女人 提交于 2019-12-05 04:53:12
Rodrigo

This is related to system permissions, the easier way to fix is create a .gnome2 folder at root home folder of the user who's running that code and give it permissions to write (666 should be fine).

Note that if you're doing this by FTP folders/files starting with . (hidden files on linux), might not show up on listings depending on your client's config.

For example:

mkdir -p /var/www/.gnome2 /var/www/.config /var/www/.config/inkscape
chmod 755 /var/www/.gnome2 /var/www/.config /var/www/.config/inkscape
chown -R www-data /var/www/.gnome2 /var/www/.config /var/www/.config/inkscape

Inkscape is executed by the webserver-user normally www-data. The default setup that Ubuntu provides for www-data locates the home directory of www-data in /var/www.

Ther are two possibilities:

a) Changing the home directory of www-data to /home/www-data

b) Disable the VirtualHost in /var/www

In both cases you have to change the rights of ~www-data. First "chown" the directory to www-data:www-data and give them writing privileges.

Next time if you execute inkscape via PHP (as www-data user) the missing directories will be created.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!