Yay! Got the index.php to load with that change. It's running on a physical server, but yes I'm accessing it from various other computers around the house. It's not a VM, but removing the "localhost:80" for "*:80" worked.
We're back on topic now. Going to [ip]/zm/api initially pulled up a whole new error, though. CakePHP's default page complains that "URL Rewriting is not properly configured on your server."
I rewrote the /api block to be what I used to have. You'll see that I've commented out your version for mine. Here's the text of the block now:
Code: Select all
location /zm/api {
# rewrite ^/zm/api(.+)$ /zm/api/app/webroot/index.php?p=$1 last;
rewrite ^/zm/api(.+)$ /zm/api/index.php?p=$1 last;
}
Doing that gets me back to my original issue - a CakePHP error page that reads as follows:
Warning (2): Use of undefined constant ZM_OPT_USE_API - assumed 'ZM_OPT_USE_API' (this will throw an Error in a future version of PHP) [APP/Controller/AppController.php, line 63]
Warning (2): ini_set() [<a href='
http://php.net/function.ini-set'>function.ini-set</a>]: Headers already sent. You cannot change the session module's ini settings at this time [CORE/Cake/Model/Datasource/CakeSession.php, line 581]
CakePHP: the rapid development php framework
Warning (2): ini_set() [<a href='
http://php.net/function.ini-set'>function.ini-set</a>]: Headers already sent. You cannot change the session module's ini settings at this time [CORE/Cake/Model/Datasource/CakeSession.php, line 581]
Fatal error: Uncaught FatalErrorException: [CakeSessionException] Unable to configure the session, setting session.use_trans_sid failed. #0 /usr/share/zoneminder/www/api/lib/Cake/Model/Datasource/CakeSession.php(732): CakeSession::_configureSession() #1 /usr/share/zoneminder/www/api/lib/Cake/Model/Datasource/CakeSession.php(219): CakeSession::_startSession() #2 /usr/share/zoneminder/www/api/lib/Cake/Model/Datasource/CakeSession.php(248): CakeSession::start() #3 /usr/share/zoneminder/www/api/lib/Cake/View/Helper/SessionHelper.php(134): CakeSession::check('Message.flash') #4 /usr/share/zoneminder/www/api/app/View/Layouts/error.ctp(46): SessionHelper->flash() #5 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(971): include('/usr/share/zone...') #6 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(933): View->_evaluate('/usr/share/zone...', Array) #7 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(546): View->_render('/usr/share/zone...') #8 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(481): View->renderL in /usr/share/zoneminder/www/api/lib/Cake/Error/ErrorHandler.php on line 138
Here's my /var/log/zm/cake_error.log:
Code: Select all
2018-10-19 12:29:14 Error: Fatal Error (256): [CakeSessionException] Unable to configure the session, setting session.use_trans_sid failed.
#0 /usr/share/zoneminder/www/api/lib/Cake/Model/Datasource/CakeSession.php(732): CakeSession::_configureSession()
#1 /usr/share/zoneminder/www/api/lib/Cake/Model/Datasource/CakeSession.php(219): CakeSession::_startSession()
#2 /usr/share/zoneminder/www/api/lib/Cake/Model/Datasource/CakeSession.php(248): CakeSession::start()
#3 /usr/share/zoneminder/www/api/lib/Cake/View/Helper/SessionHelper.php(134): CakeSession::check('Message.flash')
#4 /usr/share/zoneminder/www/api/app/View/Layouts/error.ctp(46): SessionHelper->flash()
#5 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(971): include('/usr/share/zone...')
#6 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(933): View->_evaluate('/usr/share/zone...', Array)
#7 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(546): View->_render('/usr/share/zone...')
#8 /usr/share/zoneminder/www/api/lib/Cake/View/View.php(481): View->renderLayout('<h2>require_onc...', 'error')
#9 /usr/share/zoneminder/www/api/lib/Cake/Error/ExceptionRenderer.php(328): View->render('error500', 'error')
#10 /usr/share/zoneminder/www/api/lib/Cake/Error/ExceptionRenderer.php(309): ExceptionRenderer->_outputMessageSafe('error500')
#11 /usr/share/zoneminder/www/api/lib/Cake/Error/ExceptionRenderer.php(213): ExceptionRenderer->_outputMessage('fatalError')
#12 /usr/share/zoneminder/www/api/lib/Cake/Error/ExceptionRenderer.php(190): ExceptionRenderer->_cakeError(Object(FatalErrorException))
#13 /usr/share/zoneminder/www/api/lib/Cake/Error/ErrorHandler.php(127): ExceptionRenderer->render()
#14 /usr/share/zoneminder/www/api/lib/Cake/Error/ErrorHandler.php(269): ErrorHandler::handleException(Object(FatalErrorException))
#15 /usr/share/zoneminder/www/api/lib/Cake/Error/ErrorHandler.php(212): ErrorHandler::handleFatalError(64, 'require_once() ...', '/usr/share/zone...', 123)
#16 /usr/share/zoneminder/www/api/lib/Cake/Core/App.php(970): ErrorHandler::handleError(64, 'require_once() ...', '/usr/share/zone...', 123, Array)
#17 /usr/share/zoneminder/www/api/lib/Cake/Core/App.php(943): App::_checkFatalError()
#18 [internal function]: App::shutdown()
#19 {main} in [/usr/share/zoneminder/www/api/lib/Cake/Error/ErrorHandler.php, line 138]