FTP Credentials requested when trying to activate WordPress Theme - php

Running an instance of Bitnami Wordpress on AWS Lightsail. Getting the following screen when trying to activate a Wordpress theme (JobCareer):
UPDATE #1 Turned on debug and saw the error information in the above screenshot.
Other themes and plugins I have tested all installed and activate without issue, so it's probably something specific to this theme.
I have made sure that define('FS_METHOD','direct'); is set inside wp-config.php file.
The wp-content folder and sub-folders/files are all chown to bitnami user and have the appropriate permissions (folder:755 & files:644).
At a loss as to what else to try. Thanks for any help you can provide! :)

It's definitely a files & directories permission issue. Move the define('FS_METHOD','direct'); line back to where it was (that change is causing a different error).
The 'www-data' user is the default user for Apache (and other HTTP servers?), in case you didn't know.

Related

Wordpress 404 after manual install

My core wordpress files got hacked because of a plug in. My site started giving malicious redirects.
While trying to edit wp-config.php, my site went fully offline. I tried a full manual reinstall because of this and I needed new core files anyway. My site is still not online. I have the database, database password, and username in wp-config.php. Also, I have everything in the document root for the correct domain. Maybe there is some conflict between the two domains with my host?
Does anybody know what might be causing this 404. I can't get access to the dashboard.
I got a backup before doing anything and I downloaded wp-content. The original database is still available.
I tried an automated install through cpanel with fresh everything and this would not get me to a dashboard.
Well, 404 error is not because you can't connect to your database. You should see Database connection error message if database is the problem. Did you edit .htaccess file maybe? You can try to remove everything there and put default one for Wordpress.
May be your site compromised. Deactivate the plugins using the file manager provided by your host and rename wp-content/plugins to wp-content/plugins-old, also deactivate the theme or rename the wp-admin folder on root directory and then take a try to login. Also turn on the debugger.

Wordpress - it is impossible to edit the theme file through admin after FTP upload

I would like to change the theme file through the Wordpress Admin Panel, in menu Appearance > Theme Editor, but I've got the message:
Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.
Everything was working correctly before I've made some changes in the file and upload it through the FTP back to the server. I am able to change every other file in Theme Editor, but this one. The rights are the same as in other files I am able to change, the owner and group are the same too. It looks that everything should work, but this and only this one file I have updated via FTP I am not able to change through the Theme Editor of Wordpress Admin Panel.
Any idea what could be possibly wrong? What I have done wrong? Please help me somebody, in the most of the time I am on the "safe" network, and the server FTP is not accessible from my computer.
Thank you.
Check Theme Permission
One of the first things you got to check the theme files and folder permissions.
If you are running on shared hosting then mostly it would be alright. However, if using VPS or Cloud then you got to ensure the same user owns theme files as web server (Nginx or Apache HTTP) running.
Modify File Permissions with chmod
FYR :- https://www.linode.com/docs/tools-reference/tools/modify-file-permissions-with-chmod/
Check Security Plugins
Are you using any security plugins? Do you have the option to check their logs to see how exactly your request is being treated?
Alternatively, you can quickly disable the security plugin and verify if that works.
I have finally solved the problem. There were two things with I have mislead my question.
The first one was that I wrote "Everything was working correctly before I've made some changes in the file and upload it through the FTP" and after that I wrote it again in the comment of the answer - I was so sure that I have tried the same file before, but I have not, it definitely was another one, I am sorry.
And the second was that I did not write specific file name. The file was includes/_wp_utils.php. Somebody would maybe notice that this is the biggest file in that directory. And that was the problem. I do not know why - maybe it was too big for server processing or something else (120KB), but I noticed it later, and I have tried to split the file to a few smaller files and I have included them into the includes/_wp_utils.php with the command include_once __DIR__ . '/_wp_utils/_nth_part_of_original_wp_utils.php';.
Thank you #G.D Udara Lahiru Sampath, I absolutely liked your answer. It was useful and very important to check.

Wordpress White screen of death after migration

So after i moved my website from a local WAMP installation to a hosting provider, I am getting a white screen of death. The website is working normally, except that i cannot access wp-admin. I have tried disabling the theme and the plugins(it's now on twentyfifteen) but the error still persists. Before i disabled those, debug would show something like 'WP:Widget is deprecated, please use __construct()' so i searched online and i figured it should be one of the plugins or the theme, but that doesn't do the trick either. Now, debug shows nothing and the white screen persists. Maybe it's related to the php version of the new hosting? I have tried reaching out to them, but until they answer maybe someobody here knows what I should do. Thanks in advance for any help.
Case 1 : You can Access Admin
Remove htaccess from root
Login into admin update paramlinks
deactive and active theme you are using.
Case 2 : You can't Access Admin (Try With FTP)
Disable Plugins
your plugins by simply renaming the plugins directory to plugins.old
Disable Theme
if you rename your active theme the same way we renamed plugins, WordPress will automatically fall back to using a default WordPress theme.
Enable Debugger
WP_DEBUG, it’s a constant that you can add to your wp-config.php file on your website, that will output any specific errors that are occurring on the site the same way the Windows blue screen does.
That's it.
In my case the error was because file permissions. In localhost all the files was owned by www-data:www-data but in production the right user is root so I just need to change all files to root with:
sudo chown root:root -R /var/www
And that fixes everything

Plugins error in WordPress

Im trying to install som plugins on my WordPress site but Im gettin the error message halfthrough the progress:
"Downloading install package from https://downloads.wordpress.org/plugin/responsive-lightbox.1.4.4.zip…
Unpacking the package…
Could not create directory."
The site is hosted as localhost and Im using phpMyAdmin as database if that's to any help.
The plugins map is inside the wp-content map. I have given access so it can be overwritten and edit by anyone. But it seems not to fix my problem.
Before I could upload I had some problem with FTP. WordPress kept asking me for FTP but I shut it off by adding
<?php
define('FS_METHOD', 'direct');
?>
in the "functions.php" file. Don't know if that's critical to my problem, but just mention it to be on the safe side.
So, how do I solve this problem about plugins?
Thanks!
yours sincerely,
winterwind
Put this line of code in your wp-config.php right below your database credentials, not in the functions.php.
If this problem still occur change the permissions in your wp-content folder (and subfolders to 777 (only on localhost) by doing this in your wordpress-folder:
chmod -R 777 wp-content
This is kinda dirty, but works fine on localhost.

Wordpress plugin Invalid header error

I am working on a Wordpress site hosted by Parallels and uploaded via the plex panel.
When I am installing a new plugin, first, I am notified that the plugin has been successfully installed.
But when I click on Activate, I get an error message saying:
"The plugin does not have a valid header."
I am not sure what is causing this error, and it does on every Wordpress plugin that I try to install.
When I try to upload the plugin manually by browsing for a folder and clicking upload, I get a different error message:
"Unable to create directory wp-content/uploads/2013/12. Is its parent directory writable by the server?"
These two errors are really puzzling and neither myself or my client can install any plugins.
P.s. The above features work fine on the local server - it is just the development server that I am having issues.
Do you have FTP access to the site? "Unable to create directory wp-content/uploads/2013/12" says to me that the permissions are not set right on your wp-content folder. Set it to 755, or, if you're feeling brave, 777 (though there are security concerns there). Once the permissions are set, try reinstalling again.
When plugin key "$plugin" doesn't match with plugin files then wordpress generate this error on activation time.
You can check the code by following code
file path Error is generating from
wp-admin/includes/plugin.php
line number 920
//use following code to check the keys.
echo $plugin;
print_r($installed_plugins);

Categories