Whenever I am trying to run elgg 1.12.11 on PHP 7, it is showing the following error:
Fatal error:
Uncaught Error: Call to undefined function Elgg\mysql_real_escape_string() in /home/ckarma/public_html/engine/classes/Elgg/Database.php:651
Stack trace:
#0 /home/ckarma/public_html/engine/lib/database.php(141): Elgg\Database->sanitizeString('cookies')
#1 /home/ckarma/public_html/engine/classes/Elgg/Database/ConfigTable.php(165): sanitize_string('cookies')
#2 /home/ckarma/public_html/engine/classes/Elgg/Config.php(111): Elgg\Database\ConfigTable->get('cookies', 0)
#3 /home/ckarma/public_html/engine/classes/Elgg/Di/ServiceProvider.php(207): Elgg\Config->get('cookies')
#4 [internal function]: Elgg\Di\ServiceProvider->Elgg\Di\{closure}(Object(Elgg\Di\ServiceProvider))
#5 /home/ckarma/public_html/engine/classes/Elgg/Di/DiContainer.php(76): call_user_func(Object(Closure), Object(Elgg\Di\ServiceProvider))
#6 /home/ckarma/public_html/engine/classes/Elgg/Di/DiContainer.php(56): Elgg\Di\DiContainer->build(Object(Closure), 'session')
#7 /home/ckarma/public_html/engine/lib/sessions.php(61): Elgg\Di\DiContainer->__get('se in /home/ckarma/public_html/engine/classes/Elgg/Database.php on line 651
Kindly help!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
i think that is because the mysql interface used by elgg 1.x is deprecated and is not used in PHP7. you need to upgrade to elgg 2.1 to use PHP7 - as far as i am aware.
1.12 should run on PHP7. At least we will try to fix bugs to support it. Please file this as a bug.
Oh I see. Elgg 1.12 does require the deprecated ext/mysql PHP extension.
I had same issue
Solution is :
Are you sure this adds the ext/mysql functions? The MySqli functions are different.
Nope. Just adds MySqli support. But it's works for me (PHP7 + MySQL 5.6 + Elgg 1.12). At least for a new installation.
For replacing all mysql_ functions with mysqli_ use https://github.com/philip/MySQLConverterTool
Here is a tutorial for mysql <> PDO
Additional links:
Migrate PHP ext/mysql to MySQLi
Migrate from the MySQL Extension to PDO
Also, you can put MySQL functions back into PHP 7
My bad :(. It was PHP 5.6 not 7.0
Ok. If I need to upgrade from 1.12 to 2.1, my steps would be 1.12.11 -> 2.0.4 -> 2.1.2.. right?
yes, that will be fine
Are you sure you didn't get any warnings when you were installing? The installer checks for this.
- Previous
- 1
- 2
- Next
You must log in to post replies.