define('FS_METHOD', 'direct');

931 views
Skip to first unread message

Gyp the Cat

unread,
Apr 24, 2013, 8:27:56 AM4/24/13
to manchester-word...@googlegroups.com
Hi All,

I've recently put a new WP install on a completely new box (Ubuntu 12.04LTS) for a client, complete with Nginx, PHP and MYSQL.  Everything installed fine.

Came to get the WP up and running and I was greeted with asking me for my FTP details within wp-admin.  Which from previous experience usually means either the ownership or the file permissions were off.

So I made sure ownership was assigned to the appropriate Nginx account, and the file attributes were safe yet workable (just like I've done in the past).  Still the same FTP account details popped up within wp-admin.  Rebooted the server an scratched my head.  Set the file permissions to a web unsafe rw for all, still the same, and so put them back.  No specific errors in either site logs, Nginx logs, php logs, etc.

Did a bit of searching and came up with the "define('FS_METHOD', 'direct');" within the wp-config.php to fix the problem.  Put it in and all working fine, thank goodness.

So my question is is this something new for WP or is my server setup incorrectly somewhere?

Other sites I look after don't have this problem but they are older on a previous install.

Gyp

--

Gyp The Cat
- An Alter Ego


=====================================================
PRIVACY & CONFIDENTIALITY INFORMATION
=====================================================
This e-mail communication isn't strictly confidential, and chances are I won't mind at all if you forward it to everyone you know and your cat. In fact the only thing I do mind is people sending me chain e-mail after chain e-mail, send me the odd good one, naked bird content is usually a bonus. Or genuinly funny ones. Oh, while we're on this subject, please refrain from sending me any virus warnings. Regardless of how badly it will destroy my PC and kill my house plants if my next door neighbour has a friend who thinks his cousin in Australia may have looked at an icon which was this virus. I will take my chances into my own hands about viruses. Oh yeah, while I'm at it, that 'virus' with the teddy bear icon isn't a virus, and if you've deleted it already don't worry, if you didn't know it wasn't a virus you don't need it. If I ended up sending this e-mail to the wrong person, don't worry about it. But if you know who I was supposed to send it to and can send it on to save me time doing it that'd be great. If not just e-mail me back letting me know I screwed up somewhat and I'll no doubt apologise.

Simon Mason

unread,
Apr 24, 2013, 8:43:20 AM4/24/13
to manchester-word...@googlegroups.com
Whenever I've seen this it has meant incorrect file permissions and/or wrong file ownership. That said I've only run Apache installs not NGINX

Cheers

Simon


--
See the group blog at http://mwug.info
 
You received this message because you are subscribed to the Google
Groups "Manchester WordPress User Group" group.
To post to this group, send email to
manchester-word...@googlegroups.com
To unsubscribe from this group, send email to
manchester-wordpress-...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/manchester-wordpress-user-group
---
You received this message because you are subscribed to the Google Groups "Manchester WordPress User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manchester-wordpress-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Simon Mason
Head of Studio
Tel: 01298 938426

John Logsdon

unread,
Apr 24, 2013, 9:08:21 AM4/24/13
to manchester-word...@googlegroups.com
Gyp

I don't think it means that your settings are off but if something does
happen, I don't know whether having FS_METHOD set to direct won't cause a
problem. FTP is only used to copy date internally from the download
temporary location to where it is needed with the correct user and group. So
you can firewall it off to all IPs except the actual IP of the server (and
localhost to be complete). Unless you want your users to be able to FTP in
then I assume chroot is in action...:-)

This should be OK for plugins and themes, which need to be under wp-content
and the web server may need write access to create directories etc. But a
core upgrade might present a problem. I haven't tried this.

Interested that you are using nginx - I use it as a reverse proxy in front of
Apache and it seems to work OK with a module, mod_rpaf and a plugin. This
means that .htaccess still works - maybe some day someone will write a
restricted .htaccess parser for nginx (you only really need to check the root
directory after all, not the whole b****y tree!).
--
Best wishes

John Logsdon

Gyp the Cat

unread,
Apr 24, 2013, 12:37:55 PM4/24/13
to manchester-word...@googlegroups.com
Thanks for the help guys. 

As I said I use the exact same setup on another handful of sites and machines and have not experienced anything to this extent requiring a specific Wordpress fix in the wp-config.php.

Thinking on it more the Wordpress install created the wp-config.php automatically (so it's a safe bet the permissions are good), it's just when I went to install some dependency plugins is when I had problems.  Could it be an actual PHP filesize error I wonder?  It's set at 5mb, I think I'll investigate that and try uploading some big files too.  Actually I may flatten the server and start again just to rule out any misconfiguration issue that may jump up and bite us later on.

@John I've been using Nginx for about a year now, glad I made the switch, it feels quicker (but I have no personal evidence to back this up) and certainly has a smaller footprint.  I've never had a limitation around .htaccess and Nginx, but saying that I've only used it on dedicated hardware or VPS so it means I have full access to the configuration files.  Since the .htaccess in Nginx tends to live in the site config it's fairly easy to make the switch.  As for front end proxy/CDN/accelerator if you have enough RAM (>512mb) in your machines in the middle I've found that Varnish can make one heck of a positive difference.

Cheers again,

Gyp

--
See the group blog at http://mwug.info

You received this message because you are subscribed to the Google
Groups "Manchester WordPress User Group" group.
To post to this group, send email to
manchester-word...@googlegroups.com
To unsubscribe from this group, send email to
manchester-wordpress-...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/manchester-wordpress-user-group
---
You received this message because you are subscribed to the Google Groups "Manchester WordPress User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manchester-wordpress-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


John Logsdon

unread,
Apr 24, 2013, 1:43:39 PM4/24/13
to manchester-word...@googlegroups.com
Gyp

ISTR the default upload for nginx is 1MB. It caught me out. I changed mine
to:

client_max_body_size 2m;

in the http section of nginx.conf.

Some people do put Varnish in front but as you say it depends on the amount of
memory you have. Others think that the nginx caching is pretty efficient and
all round does a pretty good job. It's one for the future anyway.

I am just about to check my setup against the Harvard Law setup to see whether
I can improve it. Check out

http://blogs.law.harvard.edu/djcp/2010/01/nginx-as-a-front-end-proxy-cache-for-wordpress

Interestingly the Varnish documentation mentions a seminal paper by Williams
in 1961 on virtual memory - at Manchester University. We shouldn't forget
the region's impact on computing. Apart from Atlas, anyone ever tinkered
with VME/B? ISTR you could write "if if then then else else" as a legitimate
syntax since there were no reserved words!

Pip pip
Reply all
Reply to author
Forward
0 new messages