My wp-admin and is not working - php

I have a problem with my wp-admin as it is saying that:
ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums
I have tried all possible ways to fix it but I am unable to fix this problem so I need your help . The ways I tried are:
Changing the theme into default.
Deactivating the plugins.
Re-configuring the WP-Config.php file.
Did Wp-debug value , true.
Had given a closing tag in function.php file as well.
Friends my project is running well in localhost and in live the project is running but its backend is not working

There are a few possible situations that are capable of creating this error:
UTF-8 => are your files UTF-8? no BOM (have you opened live files with Notepad ++?), more info about this problem
Remove all plugins, try again to log in (to make sure there is not a plugin creating the "headers already sent by ...)
The same goes for Themes
remove the closing ?>in functions.php

In functions.php, please remove the ?> from end if it exists.

I found the answer to my question after long struggle.
1. I put a function in wp-config.php file
function : ob_start(); just above my WP-DEBUG function.
2. I changed my hosting service as there was some kind of virus in the server which was automatically changing the file permission of index.php and .htaccess files.
Finally my site is live and I am very happy for that and Thank You everyone who helped me in solving my problem.
Best Regards,
Chetan

To fix the bug:
Open file blog/wp-admin/includes/screen.php in your favorite text
editor.
On line 706 find the following PHP statement: <?php echo
self::$this->_help_sidebar; ?>
Replace it with the statement: <?php echo $this->_help_sidebar; ?>
Save your changes.
Hope it helps you.

Related

ERROR: The file 'wp-config.php' already exists

I clicked on the 'Update WordPress' link in the admin dashboard of my WordPress site, and I am getting this error:
"The file 'wp-config.php' already exists. If you need to reset any of the
configuration items in this file, please delete it first. You may try installing now."
When I try to click the "installing now" link, it seems that WordPress is installing fresh. I want to keep all of the content of my WordPress installation.
I have tried to change the name of the wp-config.php file but that didn't do anything.
Is just a browser cache.
On first URL load, you are redirected from domain.ext to domain.ext/wp-admin/setup-config.php
If you are on Chrome, just open the developers console, go to "Network" tab. Reload the page and right click anywhere in the console, and hit "Clear browser cache".
Now refresh again and you will see your website
I ran into this same issue while I was transferring a site. The issue ended up being with the .htaccess file. I fixed it by resetting my permalinks. There may be other causes to this issue but this worked for me:
Click on General => Permalinks
Click Save Changes (to reset permalinks)
Try to display the website first on the incognito tab. If it works correctly, clear the browser cache.
Once the page refresh has been completed, the website will appear.
You can use the following shortcuts to clear the browser cache.
Windows: Ctrl + F5
Mac OS: CMD + Shift + R
This usually happens when you use an old version of Wordpress files or old database, and you use partly new files of Wordpress.
All you need to do is to delete all WP files and install a fresh Wordpress (new files unzipped from a new version of Wordpress) and use an empty database.
If you're planning to migrate or move from another website, you should use the export/import function built in wordpress.
he file wp-config.php already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.
Answer:- Please Clear Your browser's cache.
Did I miss the party?
Today I have a problem like what you experienced 5 years ago. The solution is: Remove all caching plugins (Cloudflare, Jetpack, Litespeed).
Maybe you could try to delete 'wp-config.php' file, or take a backup of this file in different folder and then try again.
If you are using bluehost and did not do the one click install :
I solved this problem by deleting the default error pages 404.php 500.php etc...
I do not know why exactly this was causing this issue... Sorry for the sloppy answer but tried clearing cache and recreating the .htaccess file it didn't work.
I removed the added spaces that the Wordpress's own web 'easy installer' created in the wp-config.php file to help me out.
Guess the Wordpress's own wp-config.php ?checker? isn't compatible with Wordpress's own installer. Wow.
Once the added spaces were removed, site comes up fine. I simply modeled the spacing that is in the wp-config-sample.php file.
Because you just installed wp.
Just hit ctrl+F5 done!!!
More likely it is cache issue and this error comes when we try to install one Wordpress inside of another sub folder of the cpanel in the same Wordpress installation and it will be mostly resolved when you try to check it in the private window or another browser
For me it was file permission set to 666 changing it to 664 worked.
If someone is still for a solution.
This happened to me on an existing site while trying to update.
the problem was following line in wp-config.php near the end.
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-admin/setup-config.php');
Removing this fixed the problem.
Hope this helps.
RESOLVED: I had the same problem. post hack situation on other account, shared hosting and server NUKED. Luckily I had the backup files from one of the WP plugins but the main page didnt load, I could only go to 404 and from there to other pages but not main page, the error was wp-config eists...install...blah blah blah.....so I tried everything, multiple re-installs, changed the wp_prefix as per previous install on the fresh install and nothing helped, even ordered paid support from the backup plugin developer as I was sure that it fooked because I had Opencart also installed there but the backup was intended for WP only, my web developer also did something, perhaps removed the OC bits from DB, but thank god i managed to resolve it on my own(and justhost),. so I contacted the justhost for the SECOND TIME and they told me that the account is on VARNISH i.e. some sort of automated cache limit, so I told them to take it off and they wanted to know what have I done to reduce the LOAD to the server, so I told this and that and two seconds later everything loaded perfectly. took me about 20 hours to get main page loading, plus probably it will take 10 hours for fine tuning of the site. anyway if you contact jour host make sure you ask them if they are not blocking cahce as the first time I got in contact they couldnt help me.
I also meet with same error and Mr Pierre R is right its just a cache. Just clear your cache or check in private window. All fine.
if someone have still this error..
goto->admin->setup.php (delete this file error will be solve)
hope this will help.

wp-admin shows blank page, how to fix it?

I am working with WordPress 3.5.8. Yesterday I made some changes into it to a friend. I don't know what happened, but after some time when I try to log in at wp-admin side and execute URL www.mysite.com/wp-admin it shows me a blank page. How do I solve this? I have searched over the internet and blogs. I found it could be related to hosting problems or brute force-attack, but I don't think that that's what happened to my site.
Links I visited:
http://wordpress.org/support/topic/wp-admin-wont-load-shows-blank-page
http://wordpress.org/support/topic/brute-force-attacks-and-wordpress?replies=1
http://wordpress.org/support/topic/wp-admin-wont-load-shows-blank-page
http://wordpress.org/support/topic/wp-admin-blank-page
http://wordpress.org/support/topic/blank-page-on-wp-admin
After dozens of times trying to fix this problem reading forums and posts, reinstalling WordPress, removing white spaces, putting lines of code in wp-config.php, index.php, admin.php, I fixed the issue just by renaming the plugins folder to "pluginss" in FTP. So wordpress asked me to update the database. I updated and I could enter at /wp-admin. A plugin was causing some conflict, so when I rename the plugins folder, all plugins automatically has been disabled.
As I was inside the /wp-admin dashboard, I could rename the "pluginss" folder to the regular name and start to activate all the plugins one by one and see what plugin was broken.
Now is 100% fine.
Try turning on WP Debug. If this is happening due to a PHP error (which I bet that it is), you will be able to see what's going on and fix the error.
Go to your functions.php page and delete any spaces immediately above or below your PHP tags.
I faced the same problem and I tried many things such as trying to login through wp-login.php instead of /wp-admin and adding ob_start() in /wp-admin/index.php (if you hit the url /wp-admin it goes for /wp-admin). It showed login page but entering the username and password shows an error like "cookies are blocked due to unexpected output".
I finally got the solution: it happens because the theme or plugins that you installed are not supported.
How to check and fix:
Rename the plugin folder name and theme folder name. If opening /wp-admin and entering a valid username and password the dashboard is shown, then it worked.
Revert the folder name of plugin and theme, then activate the themes and plugins one by one, cross-checking with /wp-admin. You will find out the unsupported plugin or theme.
I also had a blank screen for my blog. The solution was to copy up a backup copy of wp-config,php somehow the 'live' wp-config.php had been replaced with a file size of zero.
In my case I had the same problem. Helped remove the wp-config.php file.
Wordpress created new wp-config.php file and wp-admin is working flawlessly now.
Rename plugins, themes folder does not help.
[6] was spot on. I had the same problem
ie a blank screen where wp-admin should have been
Renaming plugins to pluginss let me get back in.
I also had a blank screen for my blog.
The solution was to copy up a backup copy of wp-config,php
somehow the 'live' wp-config.php had been replaced with a file size of zero.
It seems that it is very important to have an off-line backup
The easy way to copy of the files is Filezilla (freeware)
You need a wordpress plugin for database backup - ie to back up all your pages and posts.
But the pros will tell you that you need to get a
Peter
All your problem is solved right now just follow this instruction:
go to your themes then de activate your current theme, just put "x" in the the first letter of your theme name.
for example this is your theme folder name: "mytheme" just put "x" in the first letter like this "xmytheme" tho di activate.
Then after that go back to your wp-admin panel then BOOM! wp-admin accessable.
When you access your wp-admin panel or you are on your dashboard, again activate your theme again, but before that. REMOVE THE "X" letter you putted in your theme name.
example: "xmytheme" just remove "x", output like this: "mytheme"
then activate it in your dashboard.
hope this help!.
In my case, I was able to see the backend, but in my front I was getting a blank page...
Nothing about debugging and disabling themes/plugins was useful...
After some research, I've realized that my index.php (located at the root directory, not the theme's one) was empty!
The only content was a message saying Silence is golden.
Using a backup I had, I could get back my original index.php and get the site working again.
It might be because of a few reasons:
Problems in your web host.
Theme related errors(You can change it by renaming theme folder).
Plugin related errors(You can change it by renaming plugin folder).
An Empty line in your wp-config file.
Code errors that can be seen by enabling Debug mode.
"define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
#ini_set( 'display_errors', 0 );"
Remove blank space in functions.php or you can also remove the last "?>"
I ran into the same problem a few minutes ago, the problem was when I uploaded my local theme I had a bunch of tags separating each function I had in there I solved this by putting all the functions in one php tag... Hope this helps.
I had this problem (not showing /wp-admin/), when I moved my site to new host. i solve this problem by:
1. Re mane activated theme's folder
2. Install that them again and active it
3. copy and re place some customized file like .css .js from backup
Now problem solved.
I just had this and it was a file / directory ownership issue.
Fixed via SSH and changing the ownership recursively (-R):
chown -R ownerID:groupID /home/mydirectory/website
Change ownerID, groupID and filepath to be relevant to your own situation.
Just reset the password, this will work.
I was also facing same problem but i renamed contact-form-7 plugin from /wp-content/plugins directory to contact-form-7-rename and problem solved.
So this is due to unsupportable plugins or theme.
That white screen of death happened to my blog, and what I did was that I renamed the theme and plugin, and everything was back to normal.
In my case, wp-admin/post.php blank screen was fixed by removing the " ?> " at the end of my function.php in my child theme. I don't know how the end tag ended in there, but removing it solved my problems.
Just visit the plugins folder and delete the last plugin you uploaded and should do the trick.
I found following solution working as I was using older version of wordpress.
Open file blog/wp-admin/includes/screen.php in your favorite text
editor.
on line 706 find the following PHP statement: <?php echo self::$this->_help_sidebar; ?>
Replace it with the statement: <?php echo $this->_help_sidebar; ?>
Save your changes.
i have wasted a lot of time to solve it , But the only solution i find is to rename your word press plugins folder and active theme , and your wp-admin will be visible , so then you can change and check for suspected plugin or theme.
first of all check your internet its connect!
second is turn on WP_DEBUG and write this codes in wp-config.php
define('WP_DEBUG',true);
error_reporting('E_ALL');
ini_set('display_errors',1);
third is rename themes and plugins folder that in wp-content folder to other name sush as
pluginss , themess
S F my english!
Had this same issue after changing the PHP version from 5.6 to 7.3 (eaphp73). So what I did was I simply changed the version to alt-php74.
So what's the problem? Probably a plugin that relied on a certain PHP extension that wasn't available on eaphp73.
Before you touch any wordpress files, just try changing your site's PHP version. You can do this in the cPanel.
And if that doesn't work, go back into the cPanel and activate every PHP extension there is. And if your site starts working at this stage, then it's probably an extension it couldn't function without. Now slowly work backwards deactivating (one at a time) ONLY the extensions you just activated.
You should be able to figure out which extension was the required feature.
Can it be a plugin that's causing the issue? Certainly. Maybe the rogue plugin just wanted that extra extension.
If changing the PHP version, and juggling with the PHP extensions didn't work, then try renaming (which automatically deactivates) one plugin folder at a time.
I have experienced the same problem as well. The reason was, that the functions.php was configured wrongly.
I did the following to solve the problem:
In my child theme, I backed up all my files
Then I deleted all of them leaving only the style.css page.
I could then log in.
On reloading my functions.php I found it was the culprit. I rewrote the php and it was fine.
My case was that I had generated code for three custom content types and then just pasted all the code in functions.php without renaming the "function custom_post_type" part of each function. After renaming like e.g "function employees", it worked like a charm....it displayed.

New server - Unable to create wordpress pages - Blank /wp-admin/post.php

Recently I moved a website to a new server. The website was working perfectly on the shared server, but I've encountered a host of permission issues and other problems since relocating to EC2. I have changed the ownership of the /var/www/html folder to apache to allow altering altering of settings on the back end of WordPress. Strangely enough, I am able to create new posts, but when I attempt to update an existing page or create a new one, I receive a blank page. [http://example.com/wp-admin/post/php] Originally I thought it was yet another permission based issue, but after researching that doesn't appear to be the case.
Steps I've taken thus far:
1) Changed ownership of the directory to apache
2) Disabled all my plugins
3) Added : php_flag output_buffering on to .htaccess (Although I wasn't sure if it mattered where in the .htaccess file I should put that command)
From the research I've done it appears that white space after the ?> could be the cause. Anyone know how I could tell which file would have this white space? Several of my files actually do not even have the PHP close tag. One additional note, my previous server was version 5.2.17 to 5.3.20. Any other ideas?
After checking the error logs I discovered that I was missing the mbstring PHP library, which has a function that was called by one of my theme files. Once added I was able to create and alter pages on the backend of WordPress without issue.
To all the folks who get this kind of error of page not displaying must check option.
turn on error reporting if you have commented the lines in your wp-config.php
#ini_set('display_errors','Off');
and than check for error.
if it has the error like this
PHP Warning: Cannot modify header information - headers already sent by (output started at /[server info]/wp-config.php:77)
than check your wp-config.php for extra space at top and bottom of the page.remove extra line spaces even. and than re-upload the wp-config.php.
Most of time this will solve your problem.
Happy Coding!!!!
I had a similar problem and by removing extra spaces before the "< ?php" fixed the issue. Although apparently it was a different theme functions file that was causing the issue. Make sure you look at the php file referenced in the php warning. In this example, it's 'wp-config', but it could be really anything.
PHP Warning: Cannot modify header information - headers already sent by (output started at /[server info]/wp-config.php:77)
Good luck!
Basically this issue happens because you have edited the file directly on cpanel editor or other simple text editor. Just create a new .php file and paste your post.php code in that file. Now save this file and replace this new one with old post.php.

Weird PHP error on server

All of a sudden, my SMF powered forum has stopped working.
In fact, PHP files no longer seem to want to open on my website. I tried uploading a blank PHP file with just a few characters of text, and it refuses to open giving the error below.
I also tried a PHPinfo file, which didnt work, giving the same error. Other sites on the same server are working.
Fatal error: Unknown: Failed opening required '/home/users/a/n/mysite/www/index1.php' (include_path='.') in Unknown on line 0
Any ideas about whats gone wrong?
Just an idea. As it happens to all php files that could to what i know only mean 2 things.
Either there is somekind of error on the php extension.
OR what it most likely is, is that SMF uses a .htaccess to make user friendly links. Which means all requests to the server no matter what (Unless specified in the .htaccess) will be sent to index.php and then be handled.
So if there is a error in the index.php or the library of some sort it would explain why no matter what php file you're looking at it gives the error.
-
One thing you could do is to take a backup of all your images in the system. Then try to install a fresh version on your local machine. Once done copy/past the images back and copy all the current php files for SMF and replace the current ones on your host with them.
-
Haven't used SMF much so I'm not sure this is the solution at all. But to me it sounds like a solution.
It seems you have broken your root document.
do chmod 755 index1.php
and it should solve the problem.
You should check the php.ini or php5.ini file. I don't believe the single ticks around '.' for the include_path are valid. Double quotes will work however.
It seems you have been hacked:
http://wordpress.org/support/topic/fatal-error-unknown-failed-opening-required-google_verifyphp
Ahh sorry reread the question. I guess this is what you may try.
Check your file permissions. by default if your web server can not read files thats what you are going to get. I could be wrong but worth having a look
so just chmod your root folder to say 755 atleast

PHP - Wordpress function file not working on server

I have a website on Wordpress and I developed some theme options in my functions.php file of the theme folder.
Everything it`s fine on my localhost, but on server I get a white page when I save the options and also some url's don't work anymore.
I developed this code from some tutorials and the problem might be the php functions used, might be to old, or to new?
Here it is, not long!
http://pastebin.com/mKJYuUE2
OW, and the admin shows my options and saves them in database!
Edit after debug on!
I get an error like this Notice: Undefined index: action in "blabla" on line 63 and 93, 94 same error. I think this $_REQUEST['saved'] is the problem, but I don't even know what this does.
Thank you very much!
Edit after debug the code
Now I fixed all my wordpress errors. Everything looks fine in my admin options, but now the problem is that if I try to delete a post, or some submit actions, I will get a white screen. On localhost I dont have this problem.
On my functions.php even if I add an echo line will give me this white page. What can I doo???
UPDATE:
Since you now know the error message. On line 63 it says "save," but line 93 says "saved." Might this inconsistency be the error?
To show error messages, add the following line to your .htaccess file:
php_flag display_errors on
That way you will see the specific error message so you will know where the problem lies specifically. Alternately you can add the following line to your wp-config.php file:
define('WP_DEBUG', true);
That should also display error messages. This will help pinpoint the problem.
My guess is you don't have short_open_tag enabled in your php.ini file on the server. Try changing the <? on the first line to <?php.
It's widely considered best practice to disable short_open_tag and use the longer <?php form instead. One of the main reasons is that it makes outputting XML a lot simpler because XML documents start with <?xml which conflicts with PHP's short opening tag.

Categories