I use phpword
, a ms-word document generator. It creates a temporary file
then it renames it to the correct .docx
format.
The user projop
owns the php script and it run it as projop
.
There isn't any httpd
involved because it's a call from a TCL
app using the exec function.
I created the php's temp folder in /home/projop/tmp
and given 0777
plus made sure it's owned by projop:projop
.
Should this belong to root
group or maybe apache
group? I'm on CentOS 6.5. not sure but I keep getting permission denied.
The php script Template.php
that renames is also owned by projop
Warning: rename(/home/projop/tmp/yRRXn0,Mission Announcement Sheet - BB&T76.docx): Permission denied in /var/www/html/doc-generate/wwwroot/phpword/src/PhpWord/Template.php on line 340 Warning: rename
I dont know what's wrong. The user who owns the script is projop
, the tmp folder is on the user's home directory and it's owned by projop
.
Im not sure what's going on.
The /tmp folder permission:
[root@project-open-v40 projop]# ls -la
total 493808
drwxr-xr-x. 7 projop root 4096 Aug 6 09:40 .
drwxr-xr-x. 3 root root 4096 Jul 9 09:37 ..
drwxrwxr-x. 4 projop projop 4096 Oct 16 2012 acs-bootstrap-installer-master
-rwxr-xr-x. 1 projop projop 27527 Jul 15 10:32 gain_fns.php
-rw-r-----. 1 projop projop 2487 Jul 17 11:49 logo.gif
-rw-rw-r--. 1 projop projop 52535 Jul 23 09:57 master
-rwxr-xr-x. 1 projop projop 3039 Jul 28 14:37 notifyPM.php
-rw-r--r--. 1 projop projop 59719 Aug 5 09:35 resetInvoice.php
drwxr-xr-x. 3 apache apache 4096 Mar 12 15:34 templates
-rw-r--r--. 1 apache projop 7966720 Jul 9 09:37 templates.tar
drwxrwxrwx. 2 projop projop 4096 Aug 6 09:54 tmp
drwxr-xr-x. 6 apache apache 4096 Mar 2 02:43 vendor
-rw-r--r--. 1 apache projop 211886080 Jul 9 09:38 vendor.tar
drwxr-xr-x. 18 apache apache 4096 Jul 7 10:40 wwwroot
-rw-r--r--. 1 apache projop 285624320 Jul 9 09:38 wwwroot.tar
/tmp folder contents:
[root@project-open-v40 tmp]# ls -la
total 152
drwxrwxrwx. 2 projop projop 4096 Aug 6 09:54 .
drwxr-xr-x. 7 projop root 4096 Aug 6 09:40 ..
-rwxrwxrwx. 1 projop projop 34854 Aug 6 09:53 G0pC83
-rwxrwxrwx. 1 projop projop 34854 Aug 6 09:42 lLm9Iz
-rwxrwxrwx. 1 projop projop 34854 Aug 6 09:46 NR8CSg
-rwxrwxrwx. 1 projop projop 34854 Aug 6 09:54 yRRXn0