PHP "Fatal error" after WordPress update - no admin access


#1

Hi,

My site went down “for scheduled maintanence” (a WordPress generated page) after a failed (automated) attempt to update to WP 3.2.0.

The following page appears:


<br><table border='1' cellpadding='2' bgcolor='#FFFFDF' bordercolor='#E8B900' align='center'><tr><td><font face='Arial' size='1' color='#000000'><b>PHP Error Message</b></font></td></tr></table><br /> 
<b>Fatal error</b>:  Cannot redeclare get_temp_dir() (previously declared in /home/a5125027/public_html/wp-includes/functions.php:2160) in <b>/home/a5125027/public_html/wp-admin/includes/file.php</b> on line <b>189</b><br /> 
<br><table border='1' cellpadding='2' bgcolor='#FFFFDF' bordercolor='#E8B900' align='center'><tr><td><div align='center'><a href='http://www.000webhost.com/'><font face='Arial' size='1' color='#000000'>Free Web Hosting</font></a></div></td></tr></table>

Or in text:

PHP Error Message

Fatal error: Cannot redeclare get_temp_dir() (previously declared in /home/a5125027/public_html/wp-includes/functions.php:2160) in /home/a5125027/public_html/wp-admin/includes/file.php on line 189

Free Web Hosting

Free Web Hosting obviously being link to 000webhost.com.

I’ve tried fixing file permissions and file ownership; no cigar.

Any help appreciated, thanks in advance.


#2

Fatal error: Cannot redeclare get_temp_dir() (previously declared in /home/a5125027/public_html/wp-includes/
functions.php:2160) in /home/a5125027/public_html/wp-admin/includes/file.php on line 189

The error message states that get_temp_dir() function is defined two times, once in wp-includes/functions.php
and once in wp-admin/includes/file.php. Looks like your site is incompletely updated after the failure.
After updating to WP 3.2.0, get_temp_dir() function is defined only on line 2159 of wp-includes/functions.php.
There’s no get_temp_dir() function defined on line 189 of wp-admin/includes/file.php.

Please update your site again by following the steps below:

I didn’t have any problem in updating my wp site with the above step. However, if you are not able to access
wp-admin/index.php, it’s better to solve the problem by posting on the Forums of http://wordpress.org.


#3

Thanks for the explanation, I figured it would be something like that but I’m new to PHP etc.

I can’t retry the update, because I get the error when going to mydomain.com/wp-admin/ - mydomain.com however shows fine.

Thanks.


#4

Attached is the updated version of wp-admin/includes/file.php. How about replacing your
file.php with this file? Please upload this file to wp-admin/includes directory and see
if you can access to the admin page.


#5

Awesome, that worked a treat.

Thanks, repped :wink:


#6

Thankssssssssssssssssssssssss !!!


#7

thanksssssssssssssssssssssssssssssssssssssssssssssss :smiley:


#8

thanks :slight_smile: it’s good


#9

You saved my life :slight_smile: Thank you very muuuuuuch!!


#10

Thanks, also worked for me!


#11

For some reason it doesn’t work for me. On the other hand I have slightly different error which is:

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘__return_zero’ was given in /home/a4818134/public_html/wp-includes/plugin.php on line 166

Fatal error: Call to undefined function is_multisite() in /home/a4818134/public_html/wp-login.php on line 86

I would be gratefull for any suggestion what to do. Issue is bassically the same - web page works but I’m not able to log in as an admin :frowning:


#12

Fatal error: Call to undefined function is_multisite() in /home/a4818134/public_html/wp-login.php on line 86

is_multisite() function is defined on line 644 - 652 of wp-includes/load.php file as follows:


function is_multisite() {
	if ( defined( 'MULTISITE' ) )
		return MULTISITE;

	if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) )
		return true;

	return false;
}

Please check if the function is included in your load.php file. If not, please add it
to your file. Also, I attached the load.php file in case your load.php is not working.


#13

Thanks ssssssssssssssssssss


#14

I have setup a couple of WordPress situations (S) to test this:

*S1 - Old version -> Update
Outcome:
Absolutely fine

*S2 - New Version
Outcome:
Still no errors

Have you modified something?


#15

I have taken a little while to play with WP and it seems its a few things causing the problem:

There is actually a DataBase connection problem with the code. It seems that a permission is needed that either doesn’t exist in our ancient version of MySQL Server or is perminantly unavailable.

*1 WP’s coding
*2 SQL Server is old version

This has been flagged as an issue to the staff.


#16

Hi, I keep getting the following error when trying to login to my Wordpress admin panel.

Fatal error: Call to undefined function is_multisite() in /home/a6827127/public_html/blog/wp-admin/admin.php on line 14

I’ve tried both suggestions mentioed earlier on in the thread (above) but still have no luck. I’d really appreciate any suggestions that might fix it. Thanks in advance


#17

I am not sure the following is your case. If not, just for information.

If you have installed multiple Wordpress sites in 000webhost.com and other hosting environment
at the same time, you need to use different email address for each site. It seems that whenever
someone installs WP site, the information on the hosting server including email address is sent
to Wordpress organization at the time of installation. If you use the same email for multi-sites,
you cannot login even if you enter correct username and password.


#18

Thanks for your reply Grace. This is my first ever installation of Wordpress (so apologies if I ask silly questions) so I don’t think the above applies to me. Do you have any other idea of what could be causing this?


#19

Just uninstalled the whole of Worpress and re-installed it exactly the say way and it seems to be working fine now. Sorry to bother you.


#20

Glad that you solved the problem. There might be something wrong with the initial
installation. If error occurs for no specific reason, the best way is to reinstall.