chialab/docker-php

fatal error call to undefined function mysql_query() cakephp

Closed this issue · 2 comments

Hi Chialab - appriciate if you can help quit urgent!!

getting error php7.1 apache :

2018-07-04 12:25:10 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Css could not be found. in /var/www/html/vendor/cakephp/cakephp/src/Http/ControllerFactory.php on line 101
Exception Attributes: array (
  'class' => 'Css',
  'plugin' => false,
  'prefix' => false,
  '_ext' => false,
)
Request URL: /css/bootstrap.min.css.map
Client IP: 211.24.100.121
Stack Trace:
#0 /var/www/html/vendor/cakephp/cakephp/src/Http/ControllerFactory.php(39): Cake\Http\ControllerFactory->missingController(Object(Cake\Http\ServerRequest))
#1 /var/www/html/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(64): Cake\Http\ControllerFactory->create(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#2 /var/www/html/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(49): Cake\Routing\Filter\ControllerFactoryFilter->_getController(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#3 /var/www/html/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php(146): Cake\Routing\Filter\ControllerFactoryFilter->beforeDispatch(Object(Cake\Event\Event))
#4 /var/www/html/vendor/cakephp/cakephp/src/Event/EventManager.php(353): Cake\Routing\DispatcherFilter->handle(Object(Cake\Event\Event), Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#5 /var/www/html/vendor/cakephp/cakephp/src/Event/EventManager.php(330): Cake\Event\EventManager->_callListener(Array, Object(Cake\Event\Event))
#6 /var/www/html/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php(114): Cake\Event\EventManager->dispatch(Object(Cake\Event\Event))
#7 /var/www/html/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(79): Cake\Http\ActionDispatcher->dispatchEvent('Dispatcher.befo...', Array)
#8 /var/www/html/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(67): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#9 /var/www/html/webroot/index.php(36): Cake\Routing\Dispatcher->dispatch(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#10 {main}
root@webcash:~/var/www/html/webroot# ls
css  favicon.ico  files  fonts  img  index.php  js  return.php  store.php
<VirtualHost *:443>
   ServerName sandbox.webworld.com.my
   #ServerAlias www.webworld.com.my
   DocumentRoot /var/www/html/;
   DirectoryIndex index.php
   <Directory /var/www/html/>
       Options -Indexes
       AllowOverride All
       Order deny,allow
       Allow from All
   </Directory>
   <Directory "/var/www/html/pmadmin">
       AuthType Basic
       AuthName "Restricted Content"
       AuthUserFile /etc/apache2/.htpasswd
       Require valid-user
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   SSLEngine on
   SSLHonorCipherOrder On
   SSLProtocol TLSv1.2
   SSLCertificateFile /etc/ssl/webcash2018.crt
   SSLCertificateKeyFile /etc/ssl/server.key
   SSLCertificateChainFile /etc/ssl/webcash2018.ca-bundle
</VirtualHost>

Hi @manzurshaikh ! First of all, thanks for your interest in this project.

I think that your setup has two different problems:

  1. You're attempting to request a file that does not exist: /css/bootstrap.min.css.map.
    Is that file present in the css folder? Maybe your minify process does not produce source maps?
  2. mysql_query() has been removed from PHP in version 7.0 (read the warning here). From your stack trace, I think you're using CakePHP 3, that uses PDO, so I honestly don't know where that mysql_query() comes from. Have you written mysql_query() in your code? If that's absolutely necessary, you may use chialab/php:5.6-apache instead, but I think you should consider using mysqli_query() instead.

Hope this helps. 😉

thanks dude 👍