Writing to other directory with PHP - suexec won't allow it.

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.




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?

The output is:

drwxrwxrwx 2 kdcpmt.com kdcpmt.com 147456 Oct 12 07:25 /home/kdcpmt.com/Payments/

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

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.


Great to hear you got that working, thanks for letting us know!