One of the plugins I have been making an installer for requires the creation of two files in the root folder (not in wp-content/plugins like the rest of the plugins files), chmodded to 666. Following the documentation, I added the following to the install.php:

I don't think it should allow you to do anything higher than the install location, so I'm surprised that $this->write("../../sitemap.xml", ""); works. I'll speak to Phil about that today.

But it looks like the CHMOD isn't working. If you look in the filesystem_install_log (from administration or /var/installatron/logs/) you will probably see an error associated with the CHMOD.

But I think you should have the user install the plugin into the root directory of the Wordpress install, and that will give you full access to all the files/dirs in Wordpress. So your code would become:

Rowan wrote:But I think you should have the user install the plugin into the root directory of the Wordpress install, and that will give you full access to all the files/dirs in Wordpress.

The problem is that each WordPress plugin needs to be in the plugins folder at wp-content/plugins.

Following your suggestion, I tried nesting the plugin within folders named "wp-content" and "plugins" before zipping it up and publishing it, hoping that would allow me to install to the root folder but have the plugin appear in the correct location but, no, the process seemed to lose the extra folders and the plugin ended up in the root folder.

Rowan wrote:I don't think it should allow you to do anything higher than the install location, so I'm surprised that $this->write("../../sitemap.xml", ""); works. I'll speak to Phil about that today.

Well, I was pretty delighted when it successfully created the files in a higher location, very handy feature!

Usually, everything belonging to a plugin would live in the plugin's own folder but, in this case, because it is a sitemap generating plugin, it needs to place those files in the root folder where the search engine bots can find them. I deliberately chose to experiment with this plugin to see if Installatron would be able to handle the additional complexity.

Do you think that some sort of CHOWN command might the answer i.e. create the file, CHOWN it to the application, CHMOD it? Or would the privileges needed to CHOWN be the same needed to CHMOD it anyway?

BTW, I've just remembered that I added some custom commands to the WordPress install, installed directly into the public_html folder, to create and 666 a .htaccess in the same folder but that remained a 644 too, so, I suspect the problem isn't related to whether or not the install is being made in a lower location.

Rowan wrote:But it looks like the CHMOD isn't working. If you look in the filesystem_install_log (from administration or /var/installatron/logs/) you will probably see an error associated with the CHMOD.

None that I can identify, this is my current /var/installatron/logs/error_log:

The errors you're looking for won't show up in error_log, it will be in one of the filesystem*_log logs. The FS log is for all those $this->rm ->chmod ->write etc type commands. It would be interesting to see the entry for one of those CHMODs.

I'll get back to you on out-of-install-directory filesystem commands after I speak to Phil in the morning.

Rowan wrote:The errors you're looking for won't show up in error_log, it will be in one of the filesystem*_log logs. The FS log is for all those $this->rm ->chmod ->write etc type commands. It would be interesting to see the entry for one of those CHMODs.

Here are all 3 logs with "filesystem" in their name, starting with /var/installatron/logs/filesystem_log: