Welcome Guest, Not a member yet? Register   Sign In
CI 1.7.2. database library won't autoload -> Suhosin might be the culprit
#1

[eluser]moonbeetle[/eluser]
Fresh CI 1.7.2 installation. I can see the Welcome page...all fine, so I configure the database config file and added 'database' to the autoload array. Checked again an I immediately get a blank page. Checked again and it is the autoloading of the database that triggers the blank screen.

Did some digging in the error logs:

PHP Fatal error: SUHOSIN - Use of eval is forbidden by configuration in /... path to project ... /system/database/DB.php(118) : eval()'d code on line 118

The server I have to work on is protected with the Suhosin Extension 0.9.23
I checked the PHP config on the server, indeed it mentions Suhosin, and I see the following:
suhosin.executor.disable_eval = On

I know it's kinda off-topic as has probably nothing to do with CI, but I got to ask this.\


1. Do you know if setting suhosin.executor.disable_eval = Off is potentially dangerous?

2. Is Suhosin still relevant?
(must say I haven't encountered many servers with Suhosin installed so far)
#2

[eluser]marianas[/eluser]
I recently installed CI 1.7.2 and I'm getting the same blank screen whenever I try to load a mysql database. I can't find any evidence of a suhosin extension on my server though. Could you be more specific as to which logs you found the "PHP Fatal Error" in?

I can't find any semblance of an error that has anything to do with this. The page gets a 200 OK response and no message at all.

My CI and Apache log settings are all set to the most verbose level. I'm not sure where to go next to find out what's going on.

Here's my database.php file in case anyone wants to see it:

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "password";
$db['default']['database'] = "blog";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

(my server does allow persistent connections, and I've tried turning it off... still blank screen)

Thanks, any advice or help would be greatly appreciated!
#3

[eluser]moonbeetle[/eluser]
Check if you have a "cache and "logs" directory in your system folder and that both are writable
Next, check your PHP error log.
Next check your database settings.
#4

[eluser]marianas[/eluser]
Well, it turns out that since I'm using PHP Version 5.xx, the Mysql extension is not enabled by default. My MySQL server was not at all connected through PHP, which caused the blank white screen. Frustrating, but I'm glad I finally figured it out.

A WARNING to anyone installing PHP > 5 on windows. Make sure you enable the MySQL extension. It isn't enabled by default, and if you use the msi installer like I did, it doesn't even come packaged with the .dlls you need.

(This may be obvious to most people, but I'm new to running all these types of applications, and even though it's mentioned in a bunch of documentation, I didn't see it until I sought it out.)

Here is an awesome tutorial for setting up PHP 5.x and MySQL on Apache 2.2 on Windows:
http://webdevcodex.com/tutorial-installi...stallmysql

Thanks for quick reply, and I hope anyone else encountering this finds that tutorial sooner than I did.
#5

[eluser]moonbeetle[/eluser]
Why go through so much trouble for a local dev setup on Windows when there is WAMP and XAMPP?
#6

[eluser]marianas[/eluser]
Mainly because I didn't know they existed lol. I just threw the setup together piece by piece as I started learning web dev stuff. Good to know about WAMP and XAMPP though.




Theme © iAndrew 2016 - Forum software by © MyBB