This first development post is related to an issue I encountered today in trying to get PHP files to write to the filesystem in a Plesk environment.

Problem: Recently we migrated a client’s website to a new server at Media Temple, which is set up with Plesk. In testing their new environment, they emailed that they were unable to upload something via an upload form on the website. Apparently, Plesk doesn’t allow a PHP file to write in its default settings. After doing some research I came up with the solution.

Solution: We need to first ensure that our owner and group of the httpdocs folder is set accordingly. The next step is to give the group write permissions. Then it gets fun, when we  add Apache to our psacln group.

  • First we will ensure that our folder has the correct owner and group assigned to it (Quick note: [username] should be the username that you setup for the domain through Plesk):
[[code]]czozNjpcImNob3duIC1SIFt1c2VybmFtZV06cHNhY2xuIGh0dHBkb2NzL1wiO3tbJiomXX0=[[/code]]
  • Next we want to give the psacln group write permissions:
[[code]]czoyMjpcImNobW9kIC1SIGcrdyBodHRwZG9jcy9cIjt7WyYqJl19[[/code]]
  • Next we need to edit /etc/group & /etc/group-. Locate the following in the /etc/group & /etc/group- file:
[[code]]czoxMzpcInBzYWNsbjp4OjI1MjRcIjt7WyYqJl19[[/code]]:
  • Change the previous line to the following:
[[code]]czoyMDpcInBzYWNsbjp4OjI1MjQ6YXBhY2hlXCI7e1smKiZdfQ==[[/code]]

After all this you will want to restart Apache and all will be well.

This wraps up the first Development Post. If you have any questions or comments regarding this solution please feel free to let us know !