Wordpress won't allow me to download updates, plugins or themes - wordpress

Two days ago we've received a project to realize for my school. We have to build a website using Wordpress.
As told in the title, I can not manage to install plugins, themes, updates and probably some things more from the admin panel.
When I try to download a theme, for example, I get the following message: "Can not locate themes directory".
However, I've been able to install two themes (actually one theme and its parent one, dont know if it matters) by downloading them as zip, and unzip in the wp-content/themes folder.
I've also added some lines to my wp-config.php file:
define('FTP_BASE', '/wordpress');
define('FTP_CONTENT_DIR', '/wordpress/content');
define('FTP_PLUGIN_DIR', '/wordpress/wp-content/plugins');
define('WP_CONTENT_DIR', dirname(__FILE__).'/wordpress/wp-content');
define('WP_PLUGIN_DIR', dirname(__FILE__). '/wordpress/wp-content/plugins');
define('WP_CONTENT_URL', '127.0.0.1/wordpress/wp-content');
define('WP_PLUGIN_URL', '127.0.0.1/wordpress/wp-content/plugins');
I am using Ubuntu with apache2, mysql and PHP7.2
Any suggestion is welcome.

check your site origin at file manager and left click to make sure that your site has permission to create/upload/etc activities

Related

update failed during plugin installation of wordpress

I'm trying to install a woocommerce plugin on my wordpress website(locally) it is giving such error 'update failed' as you can see in picture,
how to fix this?
Go to wp-content/upgrade directory and change folder permission to 777 (chmod) or in windows make sure that the read only box is uncheck.
That only means you allow that directory to read write and execute without any restrictions.
You can also solve this error by increasing the execution time.
Just go to your Xampp Control Panel, Stop Apache server, click on config (Apache), then select PHP(php.ini) option, Press Ctrl+F type "execution" and hit enter, then just increase the size of execution time from 30 to 300, save the file and then start Apache again.
It Works for Me!
see sometimes there is compatibility problem of site effects. If you can not fix, you can install another similar plugin
or
install a plugin that stop the updates of plugins ot theme according to what you want, to stop only the update of this specific plugin, like
https://wordpress.org/plugins/block-specific-plugin-updates/
after when you fixed or come new version you restart the update procedure
An alternative that works for the installation of plugin is to upload the plugin via cPanel's File Manager or the FTP client (e.g FileZilla).
Download the WooCommerce Plugin from https://wordpress.org/plugins/woocommerce/. This will download a zipped file which can be uploaded onto the server.
After download, navigate your way to the wp-content/plugins folder on the cPanel. Upload the downloaded file, and extract the file to folder.
NOTE: remember to remove the version number from the name of the plugin after downloading e.g change woocommerce.4.0.1.zip to woocommerce.zip
It sounds like the files might have been corrupted during the update.
You’d need to access your site FILES, so that you can delete the WooCommerce plugin folder.
Locate the plugins folder, and remove the woocommerce folder from there. Once deleted, you should be able to go back to your site’s Dashboard and install the plugin again.
If you install any plugins/themes, this could be the reason for continuously fails. Add the below line of code in wp-config.php
define('FS_METHOD','direct');
Download .zip From wordpress org/plugins/woocommerce/

Wordpress cannot create directory on theme install

Brand new site. latest version. All glossy and etc.
I went to add a theme. It asked me for my FTP login details. I added these, but now it just keeps falling over and saying:
Could not create directory
Where to from here?
Add this to your wp-config.php file, so it will not ask for FTP again.
define('FS_METHOD', 'direct');
If it does not work there are alot of solutions here
After that make sure your theme directory has the right permission you can read more about permission here: codex wordpress file permission
If you are not sure about permission, change wordpress, wp-content, wp-includes, wp-admin, plugins and themes to 755 and then install your theme.
Found it: ISPConfig3 does not work on Amazon Web Services because every user needs access to the instance, and adding them is a manual process :(
Swapping to Plesk.

Fresh Wordpress install on Amazon Linux EC2...can't delete and reinstall

I just recently started by creating a EC2 instance on AWS. I used the Amazon Linux package. I changed the PHP settings to include the ability to upload files larger than 200MB. Got phpinfo.php working. Installed phpMyAdmin. Everything looked good.
Next, I installed Wordpress. It worked great. Then I tried installing a theme. Worked great. Then I started installing some plugins for that theme. Something made the site crash. I tried a few things, but since I couldn't go to the sites Wordpress Admin panel, it seemed hopeless. So I decided to start from scratch. I deleted the html directory (including wp-content) and dropped all the wordpress tables. I moved a fresh copy of Wordpress into the html directory, reconfigured the config.php file, and it recreated the Wordpress tables in the database. Seems to work great. When I try to upload a theme, it says:
Connection Information
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.
I noticed that wp-content didn't have a uploads directory, so I created one. That seemed to let me upload the theme, but it showed up as a media file. I moved it to the theme directory and that worked. But when I tried to upload a plugin, I got the same message as a above.
What happened when I deleted everything? Or rather, where was information stored that when I reinstalled Wordpress, it didn't create a uploads directory? I am fine with reinstalling Wordpress from scratch, but I don't want to reinstall the whole LAMP stack or redo the AWS instance. Any thoughts?
The issue is that your web server doesn't have the proper permissions to write to your content directory.
The WordPress Codex has some good info for proper file and directory permissions. Ideally, all files should have 644 permissions, and all directories should be 755 (no higher).
If you're still running into issues adding plugins and updating WordPress, you should heed the advice of the following (so that you don't have to enter FTP details into WordPress each time):
Any file that needs write access from WordPress should be writable by the web server. If your hosting set up requires it, that may mean those files need to be group-owned by the user account used by the web server process.

Where to save plugins for openshift wordpress install

I would like to upload a custom installation of openshift. I have installed wordpress and cloned it via git. Now I would like to add manually some plugins and push it back to openshift. Where do I have to put in my extracted plugins/themes?
I appreciate your answers!
Short answer: store your plugins and themes in .openshift.
Longer answer:
Every Openshift account has what can be thought of as a username - a long number like this:
53f1a90f500446c42053423083
Each directory structure features this number so yours:
/var/lib/openshift/53f1a90f500446c42053423083/app-root/runtime/repo/.openshift
will be different to mine:
/var/lib/openshift/12345678901234567890123456/app-root/runtime/repo/.openshift
The number gets incorporated into environment variables so that scripts will work on yours and mine equally. One of these is OPENSHIFT_REPO_DIR. On your install it will point to:
/var/lib/openshift/53f1a90f500446c42053423083/app-root/runtime/repo
on mine:
/var/lib/openshift/12345678901234567890123456/app-root/runtime/repo
Another is OPENSHIFT_DATA_DIR.
When you push changes from your local directory via git, the deploy script is run and it assembles all the wp files it needs into a directory it names:
OPENSHIFT_DATA_DIR/current
Openshift moves the 'original' wp plugins and themes folders that are created during a wp install into the OPENSHIFT_DATA_DIR/current/wp-content. It looks in OPENSHIFT_REPO_DIR/.openshift for your code and copies in any plugins and themes folders it finds there.
Net effect is to assemble the plugins and themes directories by adding yours to those that came with wp. So, your fully-assembled OPENSHIFT_DATA_DIR/current will have these in it:
OPENSHIFT_DATA_DIR/current/wp-content
/themes
/plugins
/uploads
So, anything you put in .openshift will be copied to the right place, but not altered.https://github.com/openshift/wordpress-example

how to install downloaded wordpress theme in xampp

I am trying to install a theme I downloaded from this website.
I am using XAMPP and I am not sure how to install this dowloaded theme using XAMPP.
I tried installing this theme with the zip folder (in zip format) in Wordpress but I get the error
” The package could not be installed. The theme is missing the style.css stylesheet.
Theme install failed. “
I found a similar on Wordpress website but they mentioned using FTP but I don’t know how to use FTP with XAMPP
I want to install the theme and test it out locally before I make it live or buy a domain name.
This is my first time doing this (I am a student) so I don’t totally know how things work together, don’t know if I am using the description/terms but I hope I described the problem well enough.
How to go about this? Any help will be appreciated.
Thanks
OK so its a bit weird that the theme you downloaded is missing the CSS file. When you upload it Wordpress is trying to find that file and failing. For now, let's assume that the creator of the theme put the CSS file in a different location than usual.
To install a theme manually via XAMPP do the following:
Locate XAMPP's htdocs folder. This is normally Applications>>XAMPP>>HTDOCs on Mac or My Computer>>C:>>XAMPP>>HTDOCs on Windows (I think - someone might need to correct me on that).
If your site is installed in a sud-directory in htdocs, go there. If not skip to next step.
Open the wp-content folder
Open the themes folder
Copy in your downloaded theme and extract it there (if its zipped)
Go to your Wordpress Dashboard and go to the Appearance button on the left and click Themes from the drop down. Find your newly installed theme and hit Activate.
That should do the trick unless your theme is missing some vital elements
(PS: what your are doing here - moving (theme) files from one location to another - is essentially the same as FTP. Difference is FTP allows you to transfer files accross the internet from computer to computer: say your computer to a web server hosting your site.)
Add this lines to your wp-config.php file
//** To add the direct installation of the themes **//
define('FS_METHOD', 'direct');
Then go to wp-admin and click on customize your site. Press on change button on the active theme and browse for your favorite theme from wordpress.org and install then enjoy

Resources