Can't Access WordPress dashboard after update - php

I just updated a dev site I'm working on to the latest version of WordPress, immediately after doing so I can't access /wp-admin/
on /wp-admin/ I get this error on Chrome if DEBUG isn't turned on - "ERR_TOO_MANY_REDIRECTS"
Trying to access /wp-admin/admin.php I get a 404 error
If Debug is turned on in wp-config, I see the following on a blank page:
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/*****/public_html/wp-includes/wp-db.php on line 1569
Warning: Cannot modify header information - headers already sent by (output started at /home/*****/public_html/wp-includes/wp-db.php:1569) in /home/heavy/public_html/wp-includes/pluggable.php on line 1216
I've tried removing all plugins, deleting HTACCESS & reverting it back to the default version, removing all customizations to functions.php, updated PHP version to 5.6 .. nothing is working.
Anyone have an idea of how I can further troubleshoot this?

Try in a different browser. Some browsers annoyingly cache redirects. The only way to truly find the underlying cause of this is to turn everything back to vanilla WordPress. 2017 theme, no plugins activated. Then systematically turn them back on to see which is causing the error. Often these kinds of errors are caused by poorly developed code "somewhere" in the code base (either as customisations within core WordPress files, which you should never do by the way, customisations in parent theme files, which again you should never do, customisations within plugins, which again you should never do. This type of error can also be caused by trailing white spaces in various PHP files, so think about what you've just customised and undo everything.

This is weird, but I get into similar issues. Can you try:
keep the plugins disabled
download a fresh new WP from wordpress.org and upload all its content except wp-content folder and note for difference between local files and distant files
be sure that .htaccess fits to your needs
open a browser that you never used on this website and go to /wp-admin
I also had this error because of WP UTF8 files containing BOM. I had to use a tool to remove it programmatically (something like this: https://github.com/GloryMind/Remove-bom-plugin-wordpress/blob/master/removed-bom.php).

Related

Wordpress displaying old PHP errors

I have a WooCommerce website that has been created by other party. When I was editing a template file and checking a minor change, a PHP error appeared on top of the page (literally the first line in the document, above )
[12-Jun-2017 19:08:58 UTC] PHP Fatal error: Call to undefined function add_action() in /home/SITENAME/public_html/wp-content/themes/booklovers/widgets/top10.php on line 8
I do know what it means, but it appears that the error itself is not the issue. The time does not change, it constantly displays 19:08:58. I've also tried renaming/moving the file to see what happens - and nothing happens at all. It is being executed, because the page results with a white screen when I put exit; in it. Renaming made no difference. Checking this path by file_exists() called in index results with false. In my opinion it has something to do with Wordpress, because if I put exit; on top of the index.php the page is totally blank, without error, so it is not being merged with the response by Apache or something. Also setting the error reporting in index/config has no effect (I realize that this is generally a bad idea, and would not leave production with a workaround like this).
My guess is that the error might be some kind of a cached artifact. But this WooCommerce has no cache plugins installed so far... I have only a minor experience with Wordpress, I do know the basics, but debugging this type of issues is a terrible pain. I would appreciate any tips suggesting where should I look.
Additional information worth mentioning: shared hosting on GoDaddy (not my choice...), php 5.6.
Resolved. A theme's error_log file was being prepended to the response.

500 internal server error on drupal admin pages when adding a custom theme

I am trying to accomplish adding a custom theme to a drupal installation. Here is what I am doing and here is what I have tried:
I am downloading an instance of drupal 7 using acquia devdesktop.
I am using either php version 5.5 or 5.6.19 (both versions still get me the same error eventually.
I then navigate to sites/all/themes/ and create a new theme. In my case the folder is called homesite. I then add the files:
-homesite.info
-screenshot.png
And then here is when it gets a little tricky. I am able to see my new theme under the appearance tab in the drupal admin UI. I am able to enable my theme after clearing the cache. I am even able to add a page.tpl.php and start to see my theme come to life. But when i start adding more files - like html.tpl.php I immediately start getting a 500 insternal server error on the admin pages only. Sometimes i am not even able to add a page.tpl.php file before this starts happening.
After i start getting this error, i am no longer able to see any updates on any of the files take hold, but only once I start getting this error.
This tends to make me believe it is a memory limit issue, but when i change the memory limit in php.ini, I then only get a white screen on all urls.
I have tried uncommenting lines in the .htaccess file like 'RewriteBase /' and so on and so forth to no avail.
The answer is that when drupal was scanning my theme directory for .info files, it was getting caught up with all of the .info files in my node_modules directory.
Follow the directions on #4 on this link (#12 takes it a step further)
https://www.drupal.org/node/2329453

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.

Broke PHP and caused Wordpress white-screen on Admin

I was doing some work on a wordpress site and another programmer had also been working on it. I was doing the design work, he was doing some custom PHP scripts. (we don't know each other.)
Some of his code was inserted in the wrong place and I made a few changes that I was confident I could undo if they broke the site. 5 hours later I go to log in and all admin screens are blank white. The site is still up and running though.
I tried to switch out the files I altered via ftp, but I must be forgetting something because it is still not working.
I checked the error log on the server and found one fatal error:
[01-Mar-2012 11:25:34] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home5/bestbik1/public_html/silvertoday/wp-content/themes/genesis/lib/init.php' (include_path='.:/usr/lib64/php:/usr/lib/php:/usr/share/pear') in /home5/bestbik1/public_html/silvertoday/wp-content/themes/streamline/functions.php on line 3
I am not experienced enough at PHP to know how to proceed to get the admin back up and working.
What does each part of this error mean specifically?
and
What steps do I take to correct or troubleshoot?
UPDATE
Finally gave in and did a fresh install of the most recent version of the Genesis theme framework. Everything works again. Wanted to find the bug, but sometimes you gotta move on. Thanks everybody!
It looks to me like you're using a child theme of the Genesis theme framework. Certainly, you've got a functions.php file in your "streamline" theme that's trying to include Genesis's init.php, which is normally the first line of any Genesis child theme's functions.php.
Assuming that your theme is a Genesis child theme, it looks like your Genesis theme install has become corrupt, with its lib/init.php missing or having the wrong permissions. I'd try removing the Genesis theme and reinstalling it (which may mean deleting and re-uploading the wp-content/themes/genesis folder.)
(You didn't uninstall the Genesis theme, did you? If you're using a Genesis child, Genesis has to be installed even if it's not the "active" theme.)
The error means that a required file :
/home5/bestbik1/public_html/silvertoday/wp-content/themes/genesis/lib/init.php
Could be not opened - there could be a number of reasons
The file is not present
The webserver does not have the correct permissions to read the file
I would first check that the file is present on the server in question.
Using the require_once() or require function in PHP means that is a required file cannot be opened the script is halted - this is the reason for the white screen.

Cannot Edit WordPress Themes - Various Errors

Our WordPress 2.8.6 installation is returning multiple different errors when trying to edit theme files via wp-admin. The errors are as follows:
"Invalid index."
"The data area passed to a system call is too small"
"The parameter is incorrect."
We've tried deactivating all plugins to no avail. We also tried creating a blank "plugins" directory and also still experienced these errors. Some theme files we are able to edit (very few), but most give one of the three errors above. We also tried switching back to the WordPress Default theme with the same results.
This installation is running on a Windows 2003 Server, IIS 6, PHP 5.3.0, FastCGI 6.1.36.1, and MySQL 5.1.40-community.
Sounds like your IIS config is messed up.
Try posting on serverfault.com too, this is more of a server config problem than a programming problem I think.

Categories