Wordpress PHP issue - possibly related to hosing/permissions

Apologies - I posted this in the general PHP help area but it would probably be more suitable here (I posted as a guest there so I’m not sure if I can delete the original thread).

Hello all,

I’m a complete newcomer to PHP so forgive me if this isn’t even a PHP-caused problem.

We use a custom theme on our Wordpress site built by a design agency. We recently changed our web hosting provider and roughly (but not necessarily exactly) around the same time we started seeing a PHP error message at the top of our Wordpress dashboard.

The usual error message is as follows:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'admin_init' not found or invalid function name in /homepages/31/d575245533/htdocs/data-broker.co.uk/wp-includes/plugin.php on line 503

We have severely reduced functionality on our dashboard. We’re unable to search, see content or update pages. When we try, we see a blank page with the following error messages:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'admin_init' not found or invalid function name in /homepages/31/d575245533/htdocs/data-broker.co.uk/wp-includes/plugin.php on line 503

Warning: Cannot modify header information - headers already sent by (output started at /homepages/31/d575245533/htdocs/data-broker.co.uk/wp-includes/plugin.php:503) in /homepages/31/d575245533/htdocs/data-broker.co.uk/wp-includes/pluggable.php on line 1207

Warning: Cannot modify header information - headers already sent by (output started at /homepages/31/d575245533/htdocs/data-broker.co.uk/wp-includes/plugin.php:503) in /homepages/31/d575245533/htdocs/data-broker.co.uk/wp-includes/pluggable.php on line 1207

It appears to be a problem with a PHP file relating to plugins. I’ve tried disabling all plugins one by one and even with all plugins disabled it makes no difference.

I’ve contacted the agency who built the theme and they sent the following response:

We've had a quick look into this and it appears to be a server issue. Wordpress was functioning normally when it was on our server - it looks as though your new server has error reporting set to a different level and is causing the admin system to malfunction on a non-fatal error.

The site is also using a lot of plugins, this can cause conflicts and errors as they are all built by different people - we’d recommend switching the plugins off one by one and seeing if any of them are causing the issue

I’m not sure whether to pursue the issue as a hosting-based problem, a plugin-based problem or a simple PHP error.

As I say, I’m a newcomer to PHP and an amateur at coding so this goes way above my head.

I’m hoping somebody could help me troubleshoot the problem or direct me to where I could fix it.

Also, our version of Wordpress, our database, and all plugins are up to date to latest versions.

Well, Watson91, first, I always suggest moving a site to a second server BEFORE you make it live.
It appears that you moved it without verifying all of your server settings, PHP settings and plug-in settings.
These can be a nightmare to fix.

Do you still have access to the old server? Did you run the phpinfo() function on it before dumping it?

Do you know which versions of PHP and Wordpress you are using on the old site and new one? It might be
something as simple as dropping back on the version of PHP you are using…

Next, how did you migrate from the old server to the new one? Normally, you should set up the PHP on the
new server and run the phpinfo() function on both to verify they are the same. Then, you install Wordpress
and verify that they are exactly the same version. Then, you install all of the theme and plug-in software.
Then, you move the site over to the new server.

The first error message you showed is due to a bad plugin on line 503. Most likely you forgot to install one
of the various plugin’s that your site uses. You can look at the old site to see which plugin’s you are using
on it and then install them on the new site. (Or pay the theme creator to do this.)

The second error you posted still showed plugin’s that were bad. And, that is what your previous coder
told you were bad. Therefore, I will guess that one of your plugin’s was not installed correctly or one of
them is a newer version than what was on the old server.

Doubt I am helping much with this. But, a couple other issues that may be involved is your error display
level in the PHP.ini. Since these are “warnings”, it might be just as simple as that. To explain…

The warnings mention “headers already sent by…” ! What this means is that text or displays were already
sent to the browser and then the or of the page was sent out. You can’t do that. One or
the ohter. So, I might guess that the first error warning was echo’d out and that meant that it implied a
header and that is why the others came along afterwards. So, suppressing warnings would handle that.
This is exactly what the other tech mentioned.

So, just suppress warnings and see if it fixes it. This is done on some servers in the PHP settings in the
control panel of the server. In others, you need to do it in the PHP.INI file in the server. You can do it on
the pages that are throwing the error out using: ini_set(‘display_errors’, ‘Off’); But, this would mean
changing a lot of pages, I think. Most likely it is the default error reporting setting on your new server.

To check the default settings for all of your PHP options, create a file on the server with just the one function
on it. One line: phpinfo(); Then, bring it up in a browser and it will show you everything you need. You
can copy it and paste it into a doc for future reading… Look for the settings for your error reporting levels.

For levels: http://php.net/manual/en/function.error-reporting.php
Note that in the PHPinfo() function, error levels are bits, so it might look like 4095 meaning that certain
bits in the value are set… Sometimes hard to sort out…

Good luck, hope this helps a little…

Sponsor our Newsletter | Privacy Policy | Terms of Service