How debug Tutorial - News section to pass "We seem to have hit a snag. ..." |
Hello,
i'm at very first attempt to use PHP and CodeIgniter4 . I have installed Apache2.4 and PHP7.2.22 and set SQLServer on Windows10 and test them all together using this code: <?php $serverName = "MyPCName\\sqlexpress, 49172"; //(default port is 1433) $connectionInfo = array( "Database"=>"News4CodeIgniter", "UID"=>"sa", "PWD"=>"MyPassword"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established.<br />"; }else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true)); } ?> So far so good, I have seen: "Connection established" on my browser. Now I installed CI4 using Composer: composer create-project codeigniter4/appstarter newsapp -s rc then: composer update and follow all the steps from Tutorial - Static Pages with success, then News Section where I hit the problem of debugging because I obtained just an very unfriendly message: Woops! We seem to have hit a snag. Please try again later... I had already set into app\Config\Database.php the database $default variable with: public $default = [ 'DSN' => '', 'hostname' => 'MyPCName\\sqlexpress', 'username' => 'sa', 'password' => 'MyPassword', 'database' => 'News4CodeIgniter', 'DBDriver' => 'sqlsrv', 'DBPrefix' => '', 'pConnect' => false, 'DBDebug' => (ENVIRONMENT !== 'production'), 'cacheOn' => false, 'cacheDir' => '', 'charset' => 'utf8', 'DBCollat' => 'utf8_general_ci', 'swapPre' => '', 'encrypt' => false, 'compress' => false, 'strictOn' => false, 'failover' => [], 'port' => 49172, ]; Now I'm stucked, I don't know what is happened backstage and I don't know how start debugging, where to set something and where to look for seen what is happening, why I cannot move forward. I found into the root of my application folder the file named: env and changed the line: #CI_ENVIRONMENT = production into: CI_ENVIRONMENT = development and restart the server with the command: php spark serve from command line . Starting again the application with: http://localhost:8080/news and hit again the same cryptic message:[url=http://localhost:8080/news][/url] Woops! We seem to have hit a snag. Please try again later... Please explain or point an tutorial for debugging for newbies, I chose CodeIgniter4 and already invest few days of work to achieve theese, now I want to move forward but I cannot without external help. Thank you in advance. |
Welcome Guest, Not a member yet? Register Sign In |