Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incoming email to PHP: need to write attachments to web directory

Tags:

php

email

I have a PHP script that is accepting all emails (wildcard) to my domain, and inserting the data into MySQL.

The beginning of the script has this line:

#!/usr/bin/php -q

It then looks like a regular PHP script. The part that writes the attachments to disk seems to work but the permissions on the new folders where they're stored were created by the 'nobody' user.

How can I edit permissions so that after these files are written to disk, they can be accessed by the webserver/webserver user?

Thanks for the help!

(Fedora 14 Linux server, Postfix)

like image 488
grandcameo Avatar asked Apr 18 '11 01:04

grandcameo


1 Answers

You can preform your file system operations by FTP so you will have the same permissions as your user. its better then give all the PHP users on server access to your files. http://php.net/ftp

like image 107
Bnaya Avatar answered Nov 17 '22 09:11

Bnaya