[Wordpress] Fatal Error in file.php
When trying to use automatic installation and updating of plugins you get a blank screen and your logs show an error such as this:
1 | PHP Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /somedirectory/wp-admin/includes/file.php on line 688, referer: http://somedomain.com/wp-admin/plugins.php |
, then most likely your or your host moved your site without updating wordpress.
Never fear as there is an easy fix. Open up your database GUI, such as PHPMyadmin and goto the wp_options table. Then find the row that has “ftp_credentials” as the option_name, click to edit the value.
Now here comes the tricky part.
You’ll see something “like” this:
1 | a:3:{s:8:"hostname";s:14:"somedomain.com";s:8:"username";s:8:"someuser";s:15:"connection_type";s:3:"ftp";} |
It is very important that the s:[some number] be the exact number of characters in the proceeding quoted word. Example in the code above you see s:14:”somedomain.com”; .. You’ll notice that somedomain.com is 14 characters long and it is a string. (hence the s in front of it). As long as those numbers match the character length you’ll be fine.
Hope this helps someone!
Wow was looking for a fix for this :) thx it worked perfectly!!
Same for me, I have been looking for this for weeks now and you saved me :)
I also had to change the first letter from f to a. Could you perhaps tell me what this does?
The a means array, I’m not sure what the f means…
Stunning, I didn’t know about this topic until now. Thx!!