skip to Main Content

A client’s host has recently updated their server to run PHP 7, which has broken their EE 2.5.5. site (“Call to undefined function mysql_connect()”).

I tried upgrading EE to version 2.11.9 but get errors:

Frontend: can’t find safecracker_lib

Control Panel: PATH_MOD not defined in mod_structure.php, fixing this leads down a rabbit hole starting with an error related to not being able to instantiate the pagination class somewhere.

I just need to get the site running until I build a new site, what is the quickest way I can get the site running with PHP 7?

2

Answers


  1. mysql_connect() has been deprecated since PHP 5 and removed in PHP 7 so you cannot use this function or any of the old mysql functions.

    You need to upgrade your codebase, or downgrade your PHP version (highly discouraged).

    In regards to your missing pagination class, you may not have implemented core classes that were required when upgrading.

    Try running on your command line:

    php system/ee/eecms upgrade
    

    You can also read the documentation on how to upgrade the codebase for Expression Engine here.

    Login or Signup to reply.
  2. In your config folder there is a file named database.php
    change the line:

    $db['expressionengine']['dbdriver'] = 'mysql';
    

    to

    $db['expressionengine']['dbdriver'] = 'mysqli';
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search