Cannot resolve blank screen following tutorial |
Following the tutorial building a news site, I can't seem to resolve the notorious blank screen. Previously I had resolved a separate blank screen issue by setting the appropriate error reporting values in index.php and php.ini.
I'm running Apache 2.4.18, php 5.6.16, mariadb (mysql) 10.1.9, and phpMyAdmin 4.5.2 locally. Relevant code segments: php.ini Code: error_reporting = E_ALL index.php Code: define('ENVIRONMENT', 'development'); application/config/config.php Code: $config['log_threshold'] = 4; application/config/routes.php Code: $route['news/(:any)'] = 'news/view/$1'; application/controllers/news.php Code: <?php application/models/news_model.php Code: <?php Please note the log_message() calles in the controller and model. When trying to load localhost/index.php/news, the log output is as follows: Code: DEBUG - 2015-12-15 12:44:03 --> Config Class Initialized So the log_message() call after $this->load->database(); in news_model.php never runs, but I don't have any errors or information to go on. If you're still with me, I appreciate you reading this far. Does anyone know of any ways to get more debugging information out of this or any possible fixes? Thanks for any and all input!
(:any) routes have to be the last routes in the routes file,
any route below them will never run. $route['default_controller'] = 'pages/view'; // this will not work with a sub-folder. $route['news'] = 'news'; $route['news/(:any)'] = 'news/view/$1'; $route['(:any)'] = 'pages/view/$1'; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thanks for the tip! I've updated routes.php accordingly, but the result and log output remain unchanged.
Your database config might be something wrong.
Good point, I should have included that in the original post.
application/config/database.php (excerpt) Code: $active_group = 'default'; I've X'd out the credentials obviously, but I can log in from the command line with: Code: mysql -u [USER] -p [dbName] And then proceed to create/modify tables/records. Also, in system/database/DB_driver.php there are plenty of calls to log_message() in the event of an error, but I'm not getting any error messages reported about database connectivity problems.
first of all u need to find out point when your script start working wrong
I remeber that I had same problem and it was relate with DB first of all u can check connection to db with pure php second, if nothing helps try to start exit('here'); from index.php then in Codeigniter.php and so on. I remeber that i find out problem in this way where no errors and blank page
@scion,
Thank you SO much! * DB connection works with pure php. * exit(str) is exactly what I was looking for! Followed execution through DB_driver.php until the db_connect / db_pconnect call. Looking for the declarations of those two functions results in: Code: database/drivers/pdo/pdo_driver.php:95: function db_connect() Oh a whim, I uncommented extension=mysql.so in php.ini and everything works! Can't believe it was such a simple fix. I was under the impression that mysql.so was deprecated. |
Welcome Guest, Not a member yet? Register Sign In |