Submitted by KingstonDC on Fri, 10/14/2016 - 08:14 Pro Licensee
I'm trying to get a PHP script to write outside of its normal directories.
I have three virtual sites (let's call them SIteA, SiteB, and SiteC). SiteA is the primary site. SiteB and SiteC each have a script running that outputs data to the file system. I want SiteB and SiteC to write to a folder in SiteA.
I've tried adding SiteB and SiteC to SiteA's group. That doesn't allow me to write to SiteA's directories.
Is there some suexec trick I'm missing? I've tried combing their documentation, but everything is about excluding this sort of thing.
Help!
Status:
Active
Comments
Submitted by andreychek on Fri, 10/14/2016 - 10:13 Comment #1
Howdy -- which directory is it that you're trying to write to? Can you run this command on it:
ls -ld /path/to/directory
What output does that produce?
Submitted by KingstonDC on Fri, 10/14/2016 - 13:53 Pro Licensee Comment #2
The output is:
drwxrwxrwx 2 kdcpmt.com kdcpmt.com 147456 Oct 12 07:25 /home/kdcpmt.com/Payments/
Submitted by andreychek on Fri, 10/14/2016 - 14:13 Comment #3
Are you seeing an error of some kind relating to suexec?
Yeah with that directory being mode "777", you should definitely be able to write to it, unless the permissions of "/home/kdcpmt.com" are preventing you from getting there.
What is the output of this command:
ls -ld /home/kdcpmt.com
Submitted by KingstonDC on Sat, 10/15/2016 - 06:47 Pro Licensee Comment #4
I figured it out -- it was two things. 1 - The group permissions weren't set writable in the directory, and 2 - I needed to log the user accounts affected in and out, so that being added to the appropriate group took effect.
Thanks!
Submitted by andreychek on Sat, 10/15/2016 - 08:42 Comment #5
Great to hear you got that working, thanks for letting us know!