We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

trouble with FTP when installing a plugin | Forum

Regis Grison
Regis Grison Mar 22 '12
Hi,

I had some troubles installing a plugin because of FTP (and why use FTP ?).

My problem is in ow_utilities/ftp.php

I use an account that has whole access to the disk (local net only ;) and when the init() function says $this->chdir('/') it calls getPath('/') with a $this->ftpRootDir that is also '/'.
As a substr($string, 1) on a string with 1 char return false, it fails to do the chdir()

I had to append a third test (before doing the substr):
if ( strlen($path) === strlen($this->ftpRootDir) )
{
    return $this->ftpRootDir;
}

Am I right?

I must admit, I'm not really happy to have to setup a FTP account for the web user on a public server, I think I'll look for a way to avoid using FTP. I may replace that file by a class that access local files but I would prefer a cleaner way...

Regards.

Regis.
Michael I.
Michael I. Mar 23 '12
You can use SSH or Cpanel's File Manager to install Oxwall if you want. Make sure your server meets our requirements.
Regis Grison
Regis Grison Mar 27 '12
Thank you for your answer but I'm not sure to understand it.

I am talking about plugin installation, not full Oxwall installation, are you too?

If by using SSH you mean outside Oxwall admin interface, I still don't understand why using FTP as the software is already installed: it can use direct file writing.

I think I didn't get the logic behind that. Could you please explain me?

Regards.
Regis Grison
Regis Grison Mar 27 '12
Thank you for your answer but I'm not using cpanel.

I'll try to explain it better:
- Oxwall is up and running on a test server.
- I set up a ftp server on it only for installing plugins the way Oxwall does it but I don't want to have a FTP server on the production server (Oxwall is not yet installed on it).
- When I install a plugin from Oxwall admin, it needs a FTP connexion instead of writing directly (as Joomla does) on the filesystem.
- As my test server is not a classic mutualized server, the FTP account has not only access to the web directory but to the full disk so the chdir('/') failed without the patch I posted earlier.
- Basically, I don't understand the need of FTP to do this, we would have the same result writting directly on the filesystem as the plugin has already been uploaded to the server using the upload form.

Regards.
Michael I.
Michael I. Apr 11 '12
You should install plugins manually on local servers. And FTP is needed to be sure that files are overwritten on servers where PHP runs as user 'nobody'.
Regis Grison
Regis Grison Apr 12 '12
Thank you for your answer but I don't agree because :
- FTP is needed for a specific case and it causes pain for some users (look at the forum for FTP connexion problem messages)
- I am in a specific case that can be overriden by the patch I propose without trouble for the current specific case
- in my own server, I added a checkbox in configuration to tell I prefer local filesystem access than FTP, will fit most needs, will let the current behaviour available and it took 10 lines. I'll submit it soon to the devs
Michael I.
Michael I. May 13 '12
I spoke to our developers about the patch you submitted and they said that it would not work for all installations, just for those that have Oxwall installed under the root directory. Let me know if you believe we think include your patch in our build and give mem more examples of how does your patch work. Thank you.
Regis Grison
Regis Grison May 15 '12
Well, I must admit it is possible.

My oxwall is installed in the root directory of a virtual host (but not in the root of the ftp).

If they can give me a value of $path and $this->ftpRootDir that do not work with my patch, I could try to find a way that works for all installations (by the way, current code does not work on all installations either).
Mark
Mark May 15 '12
the way i get around FTP (i prefer to have it completly disabled on my server) is i .zip everything, upload it via my file manager and then unzip it to the directory that its meant to go in

Purusothaman Ramanujam
FTP is still a mystery for many users our here. I am one who is stuck with that.

I can not use SSH for every time to make even a single line of change or to install a plugin/theme.

I also don't have cpanel. I am yet to figure out the working of FTP with oxwall.
Regis Grison
Regis Grison May 24 '14
Well, I forgot I created this post. I have a fix and I posted it here:
http://www.oxwall.org/forum/topic/19528