I was using PHP 4.0 and recently upgraded to PHP 7.0 with cPanel. But now my website is down, it shows the following error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
Does this mean that I will have to completely reinstall & reconfigure all websites, or is there an easy solution within cPanel?
-- snip --
PHP 4? Wow :-P
All the mysql_whatever() commands have been deprecated a while back , and completely removed in v7 (see http://php.net/manual/en/migration70.removed-exts-sapis.php).
You should now update your code to use the PDO API.
http://php.net/manual/en/class.pdo.php
See this guide for steps involved.
https://www.sitepoint.com/migrate-from-the-mysql-extension-to-pdo/
You may have other things needing fixed too. Always check the changelogs, and look at these migration guides, which lists everything you need to know about the upgrade.
http://php.net/manual/en/migration5.php
http://php.net/manual/en/migration70.php
Your wordpress should be able to update itself by clicking something in the admin section. I can't remember specifically, but here's a link that can help. You just need to worry about the code you wrote yourself.
https://codex.wordpress.org/Updating_WordPress
Related
I will be updating our WordPress sites this weekend and I was wondering what might be the best versions to go to. Of course, the latest would be best in theory but sometimes there are bugs that have not been worked out yet so we haven't always gone to the latest and greatest.
We host internally on IIS. I have 3 sites and need to upgrade WordPress (current version 5.7.6) and wasn't sure whether to go to 5.8, 5.9 or 6. I also need to upgrade PHP (current version 7.4.21) and thinking about 7.4.28 or 8.
I was just trying to get some thoughts. If the general consensus is 6.0 and 8.0 that's fine. I don't have any custom code or rely on a lot of plugins. The only plugins I'm concerned about are Subscribe2 and Active Directory Integration.
Thanks!
I think you need to try to update your PHP, WordPress, and plugins separately on Dev environment and test each stage manually or using utility as a screaming frog.
Also, you can use next instrument https://psalm.dev/ , that helps you to check the compatibility of your code with a concrete PHP version.
I Tried to update my PHP version located on Hostgator. Actually, I'm using but PHP 5.0 and WordPress is requiring at least the PHP 7 version.
After doing that, through the c-panel, my website went down.
This is the message that I received:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress
I was obliged to roll-back so that it works again.
Please can you help me solve that problem?
Thanks in advance.
The php mysql api is deprecated. It's kaput --- going away -- not to be used, finito.
If you have a modern version of PHP (> 5.6) then Wordpress should automatically switch to make use of mysqli. That should be your first attempt.
If you can not update your php, rather than attempting to resurrect something that php no longer supports, just patch your wordpress: http://wordpress.org/plugins/mysqli/
I am still new to php and linux but i try to give you all information I know.
We got a PHP web application using pear and smarty. It's runing on PHP 4 on a Linux system and with XAMP and PHP5 on my PC. I am trying to move the application on a new server with PHP7 and updated PEAR and all extensions (it's the same version as on XAMP), but all I get is: DB Error: extension not found.
I tried to find a solution but wasn't able to find anything which could help me.
The database we are using is a normal mysql database.
I'm not sure if there is still a path missing or what went wrong.
Maybe someone of you got a clue what the problem could be.
It sounds like your very old PHP4 code is using the mysql_ database extension?
If so that extension has been deprecated for years and was completely removed from PHP7. You wont be able to move that code to any version of PHP higher than PHP5.6 and even trying to do that you will almost definitely come across lots of other incompatibilities
I suggest you read http://php.net/manual/en/migration70.php in the menu on this page there is a section on migrating from all sorts of versions of PHP.
You will have to work out how far up the migration levels your code will actually move without major amendments. I would guess, not very far!
I need the php_monetdb.dll for php 5.4. I've found that by building the monetDB with the HAVE_PHP=1 option on windows will create the dll, but the build procedure fails at numerous points. I am using the monetdb source from sourceforge which is a little outdated one. The newer version has problems in the .msc files itself so proceeding to the build itself is a pain. The older version that I am trying on is atleast passing the nmake step but failing on the nmake install step. The reasons vary from component to component. One states that the devenv /build does not exist. For this I copied the vcexpress and renamed it to devenv. I am not sure if this is right but when I run it from the command prompt it seems to work ok with a few warning alerts shown. During other make installs, the header files seem to be missing. Could anyone please help me with this. Also please let me know if there is any other alternative for this approach of getting php_monetdb.dll.
P.S: I am using windows 7, MSVC 10 express, PHP 5.4.4
For the build questions, see http://bugs.monetdb.org/show_bug.cgi?id=3121
For php_monetdb.dll, see
http://sourceforge.net/mailarchive/forum.php?thread_name=20120717145132.GU49719%40cwi.nl&forum_name=monetdb-developers
http://sourceforge.net/mailarchive/forum.php?thread_name=500581D5.8030808%40acm.org&forum_name=monetdb-developers
I'm trying to figure something out:
I am using Ubuntu server 11.10 virtualized on Win7 (I don't think that matters but more info is better than less) to work on a Drupal 6 website I inherited and need to make significant changes to.
I want to set up a development copy of this Drupal website on my Ubuntu server so I can work without worrying about torching the production website.
I successfully got the production files downloaded and onto my machine, I got the production MySQL database exported and imported into the dev MySQL server, and I set up a symbolic link from the directory /home/myname/thewebsite.com to /var/www/thewebsite.com so I can easily access it.
When I got the website they didn't know the admin password so I dug around online and reset it in the dev db using phpmyadmin and finally log in.
When logging in and poking around the site there are lots of errors, which when googled lead me to believe that PHP 5.3 is causing them and that there are some modules in use that only work with PHP 5.2
After looking around a lot online and on stackoverflow there seems to be no easy way to install PHP 5.2 on Ubuntu Server 11.10. With no packages for 5.2 available through apt-get or aptitude what should/can I do?
1) Install 5.2 from source - how do I get it to interface with MySQL and Apache2? Also, I've never installed anything significant from source. Is there a walkthrough?
2) Replace the repositories with old ones? Will this work on 11.10? The newest instructions I found were for 10.04
3) Use already built PHP 5.2 packages for Ubuntu? Couldn't find these
4) Pay someone who knows more to do it for me? (Just kidding, this isn't really an option...)
Cheers and thanks for your help!
PHP dropped support for 5.2 in August 2011; operating system providers such as Ubuntu will not supply a version that is out of support, so you absolutely won't get an official copy of PHP 5.2 on the current version of Ubuntu (or any other OS).
If you're running an older version of Ubuntu (eg 10.04), you might be able to do it; it would still be a downgrade, because PHP 5.3 has been the default version for quite a long time now.
If you're on a newer version of Ubuntu, ie 11.10 as you state, it is going to be a problem for you.
The Drupal developers dropped the ball badly on this one. I guess it was because Drupal 7 tool so long to finish; they were expecting D7 to be out much sooner, and so they never bothered fixing up D6 to work with PHP5.3. As it turned out, this was a big mistake, because in fact D7 still wasn't officially released when PHP dropped support for 5.2.
But even so, they should have fixed it, because they're still officially supporting Drupal 6, so they need it to work with the current version of PHP. This is definitely Drupal's problem, not PHP's, Ubuntu's or yours.
But you still need to deal with it.
I found this question over on AskUbuntu.com, which gives an answer applicable to 11.04. It isn't quite 11.10 you were asking for, but it it a lot more recent than the best you'd found, so it might be helpful.
Alternatively, you could research exactly what it is about Drupal6 and your specific modules that doesn't work in PHP5.3. The language differences between 5.2 and 5.3 that can break things are not big, so I would expect any code changes required to be fairly small. You might find you can fix the code yourself. And maybe even submit the changes to the community -- Drupal is open source, after all.
Another tack you could take is to consider whether this saga represents an opportunity for you to move the site to Drupal 7?
This may or may not be feasible, depending on the modules you're using, etc, but if it is possible, it will solve the problem, because D7 is of course fully compatible with PHP5.3.
And just to cheer you up, I'll close by mentioning that PHP are on the verge of releasing PHP 5.4. Hopefully the Drupal devs will be more on the ball this time.