Hot answers tagged

49

The solution I found that worked on my Mac running the built-in Apache2 was to add this to 'wp-config.php' define('FS_METHOD','direct'); Keep this to a localhost or dev setup and don't use it for production.


39

This is just, how I understood the idea of the WordPress File API. If it is wrong, please downvote :) Okay. If you upload a file, this file has an owner. If you upload your file with FTP, you login and the file will be owned by the FTP user. Since you have the credentials, you can alter these files through FTP. The owner can usually execute, delete, alter ...


23

What's the risk? On a poorly configured shared host, every customer's PHP will execute as the same user (let's say apache for discussion). This setup is surprisingly common. If you're on such a host and use WordPress to install the plugin using direct file access, all of your plugin files will belong to apache. A legitimate user on the same server would ...


14

Avoid direct upload WordPress doesn't scan upload directory for new files, instead use WordPress media uploader to add files WordPress automatically creates folder and store them accordingly. But you can use this plugin to import those uploaded files into WordPress, it should help you https://wordpress.org/plugins/add-from-server/


10

OPTION 1: If a WordPress WXR file, an XML file exported from WordPress, is too large to import, there are several things you might try to overcome that limit. Increase the amount of memory a PHP script may consume. Note: If using a shared hosting service, you may need to ask your host to increase the limit. Increase the memory limit setting in php.ini (e.g....


10

Your site has likely been hacked. My site had the Darkleech infection, which injected some malicious code into wp-includes/nav-menu.php, causing .htaccess to reset to 444 on any page load. I'd recommend you install the Sucuri plugin and let it restore any files that have been corrupted. Assuming your site was hacked, use their Post-Hack tab to reset plugins,...


8

WordPress does support making connections using SSH (aka SFTP) via the built in updater system. It got this support in version 2.7, approximately 6 years ago. Reference: https://core.trac.wordpress.org/ticket/7690 If you're not seeing it in the normal "credentials" screen, then this is because your PHP installation lacks the support necessary for it to be ...


8

Congratulation Jon, welcome to the WordPress world! To fix the issue, just add the following line of code in your installed WordPress's wp-config.php file. It's a PHP constant declaration which tells the WordPress to avoid the FTP. That's it. define( 'FS_METHOD', 'direct' ); For more info: https://codex.wordpress.org/Editing_wp-config.php#...


6

if you have access to the .htaccess file in your www folder. Just include the following 2 lines in .htaccess: php_value upload_max_filesize 50M php_value post_max_size 50M Other way .. you can place this piece of code in your theme's functions.php file @ini_set( 'upload_max_size' , '50M' ); @ini_set( 'post_max_size', '50M');


6

Sorry for posting the question above, I fixed it right after posting here, by following these steps I found on this site http://artofsimplicity.co.uk/wordpress-ftp-auto-upgrade-on-ubuntu sudo apt-get install vsftpd sudo useradd wordpress sudo passwd wordpress # set password for wordpress when prompted. sudo usermod -g www-data wordpress sudo chmod -R g+w /...


6

If you have enabled a MultiSite Network, you must first enable each Theme you wish to utilize, under "My Sites", "Network Admin", "Themes".


5

If you're on a shared server, it's unlikely your host will correct this issue, but you can add the upgrade constants to your wp-config file so it will at least stop asking every time.


5

It seems that not only does WordPress check if the directories are writable, but it checks if the Apache user OWNS the directories (or at least, if the Apache user owns the temporary file it creates). Observe these lines of code at /wp-admin/includes/file.php: get_filesystem_method(): if ( $temp_handle ) { if ( getmyuid() == @fileowner($temp_file_name) )...


5

It doesn't. WP Filesystem API will ask for FTP credentials, but it will do so for each operation. They aren't stored persistently. They can be stored persistently by hardcoding into wp-config.php, but WP won't do that itself, it's a user action. Note that WP only asks for FTP credentials if it cannot modify files without them. If specific setup used to ask ...


4

This is a permissions issue. Here are some steps to fix ownership and r/w permissions in a more secure way: // check what groups your username belongs to $ groups // if your username doesn't belong to www-data then add username to group $ sudo usermod -a -G www-data username // exit ssh session (or close terminal window if local) to make group change ...


4

After installing WordPress 5 on Debian 9 Stretch I updated (remotely on localhost) and was prompted for FTP details. Running these commands in terminal fixed the problem: chown -R www-data:www-data /var/www/html chmod -R g+rwX /var/www/html It's a file-ownership issue. Code and caveat from turnkeyLinux.com: Changing file permissions is a trade off ...


4

Parts of WordPress use (s)FTP to transfer files. Updates, for example, use (s)FTP. Media uploads do not, at least not unless something has changed in 3.7. If you are connecting to an (s)FTP server you have to provide the credentials that that server needs. Your file permissions won't come into play until after that connection is made. There are constants ...


4

Yes, the plugin @Squideyes suggests you, is perfectly fine, and should do the trick. However, I don't like the link-to-plugin only answers, so here the mine. If you upload the file to a subfolder of the WordPress uploads folder (by default wp-content/uploads, but can be easily changed) than convert a file from there to an attachment post is pretty easy via ...


4

Here's a much better solution: Don't edit the theme's functions.php file. Don't put your custom code into that file either. If you have snippets of code for a site, put them into a custom plugin. Put each one into its own plugin, in fact. Separate them by functionality. I even made a handy dandy plugin to make this easier, called Pluginception. The nice ...


4

I had to also change the owner of the root web directory. chown apache:apache . # or chown apache:apache /var/www/html Edit by Otto: Chloe, as you asked for more information than I could reasonably put into a comment, I'm appending this on to your answer. I hope that is okay. If not, feel free to revert it, or let me know and I will do so. The reason ...


4

I don´t have the reputation for a comment, so an answer must do it. WordPress uses (s?)FTP to install updates and plugins. Your SSH credentials are something different and most possibly not those ones of an FTP account. If you want to use the built-in FTP function of WordPress your hostname is normally "localhost" because you want to install something on ...


3

Try to use relative URLs to your imported css files. So try to remove first / from each import URL: @import url('styles/forms.css'); @import url('styles/tables.css'); @import url('styles/homepage.css'); @import url('styles/reset.css'); @import url('styles/stimenu.css'); @import url('styles/layout.css'); @import url('styles/demo.css'); Also pay attention to ...


3

What if you try http://wordpress.org/extend/plugins/ssh-sftp-updater-support/ ? If that doesn't work you can do a quick code change to get the logs with which the developer of that plugin can use do more diagnostics.


3

I was facing this issue. This post helped me. There could be multiple reason: Permission issue on the files and folders. The FS_METHOD should be "direct" in wp-config.php file. Remove FTP configuration from wp-config.php if you are migrating from bitnami to manage it on your own. For me it was bitnami related settings issue.


3

Depending on your version of OS X, you will need to configure and run FTP and open a port in the firewall. It's best if you google your OS X version - 10.6, 10.7, etc. - specifically and find the docs necessary to set up FTP and Sharing. You also need to realize the security implications of opening up FTP to your local machine; someone port scanning your IP ...


3

Are you using Lion? If so, Apple dropped support for managing the FTP service via the Sharing settings. But the underlying service is still available. You can manually enable it by running this command in the terminal sudo launchctl load -w /System/Library/LaunchDaemons/ftp.plist Then you can stop and start the service like this: sudo launchctl stop ...


3

Posix is a PHP extension rather than part of PHP core. WordPress tries to minimize use of extensions as much as possible in its core. In specific case of Posix one — it has very notable flaw of not being available on Windows platform altogether.


3

Of course there are better ways to do that. You could use some local installation with a copy of your online website with software such as WAMP, XAMP, etc to make your changes. "Cow Boy" coding is never a good solution. If you miss one ; boom! Fatal error! And in your case this is live. You could also use better process such as git workflows to have a ...


3

Uploading the image is only one part of the process. When you add media to your site via the Media Library, it's actually added as an attachment, a built-in post type that carries with it a bunch of metadata. Simply FTPing images into the appropriate directory doesn't create the associated attachment post or set any of the metadata. A bit of quick Googling ...


3

The code you are referring to is a menu, and in your screenshot, is likely to be the line starting wp_nav_menu... Look in your WP admin under Appearance > Menus, and you should have a Social Media Links menu it seems...


Only top voted, non community-wiki answers of a minimum length are eligible