Cake bake undefined function mysql_query on easyphp - cakephp

when i try to use the shell to build models
cake bake
M
i get this error:
Fatal error: Call to undefined function mysql_query() in C:\Program Files\EasyPH
P-5.3.2\www\cake\cake\libs\model\datasources\dbo\dbo_mysql.php on line 588
on
phpinfo();
mysql extension is enabled, i'm using mysql driver
running
if(!function_exists('mysql_query')) echo 'error'; else echo 'all fine';
on a separate file prints all fine but on
dbo_mysql.php just before line 588
prints error
i believe the database configuration is correct as on http://127.0.0.1/cake/
it says
Your database configuration file is present.
and
Cake is able to connect to the database.
i'm using the latest stable version of cakephp and easyphp on windows xp pro sp3, paths are setted correctly
any idea?
thank you

creating a "php.ini" file next to php.exe with the following content solved my problem.
EasyPHP-x.x.x\php\php.ini
[PHP]
extension_dir = "ext"
extension=php_mysql.dll

ok it was easy, easyphp uses a different php.ini than the defoult
creating one solved the problem

Related

How can I install cakephp2 in 2022?

can anyone tell me how can I install cakephp 2 in 2022 I tried many ways to install it I also have its zip file which I extract it and when I tried to run it it shows.
Fatal Error
Error: Cannot use 'String' as class name as it is reserved
File: E:\xampp\htdocs\cakephp2.3\lib\Cake\Utility\String.php
Line: 27
Notice: If you want to customize this error message, create app\View\Errors\fatal_error.ctp
CakePHP 2 needs php5
since Version 2.8 you can use php70
php71 is possible but you need to install mcrypt seperatly.
Its possible to run a CakePHP 2.8 on php72 with some core hacks. But i wouldn't recommend this.
I got my answer we can download its zip file from github and copy its file in htdocs folder and run it without an issue. By the way I downloaded cakephp 2.10. and it is also running in xampp with php version 8. If in your system it is not running then try to use xampp with php version 7.

Call to undefined function sqlsrv_connect() using WAMP and php 7.1.6

First things first, I read and tried stuff I found online even from this website, but can't get it to work.
I have an SQL SERVER 2014 running on Windows Server 2012, there I have a WAMP 64 bits running Apache on PHP 7.1.6 and need to connect to the Database, apparently the extension is not loaded because I'm getting the undefined function error.
$conn = sqlsrv_connect( $APIDBSERVER, $connection);
What I've done so far:
Installed Microsoft® ODBC Driver 11 for SQL Server
Downloaded PHP SQL Driver 4.0 and moved php_sqlsrv_7_nts_x64.dll to /ext
Added them to php.ini:
extension=php_pdo_sqlsrv_7_nts_x64.dll
extension=php_sqlsrv_7_nts_x64.dll
Apparently the PDO also needs php_pdo.dll which WAMP doesn't have and I haven't found where to download it from, so I'm using the standard non-PDO approach
Recently even tried enabling odbc extensions which were disabled:
extension=php_odbc.dll
extension=php_pdo_odbc.dll
I access the php.ini through the WAMP menu so I know I'm editing the right one, restarted the server several times trying different things but I've run out of ideas.
Can you please help me?
EDIT:
PHP error log indicates the modules couldn't be found, but if I check that path they're right there, copy&pasted filenames into php.ini.
PHP Warning: PHP Startup: Unable to load dynamic library
'c:/wamp64/bin/php/php7.1.6/ext/php_pdo_sqlsrv_7_nts_x64.dll' - The
specified module could not be found. in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'c:/wamp64/bin/php/php7.1.6/ext/php_sqlsrv_7_nts_x64.dll' - The
specified module could not be found. in Unknown on line 0
EDIT 2:
Tried downgrading to 7.0.20 and get the same error, so the php.ini is fine, it just won't load them for a reason, will try to download ODBC 13.1 maybe?
Each PHP version might require a different version of the Microsoft PHP Drivers for SQL Server.
The link below shows compatibility between PHP and MS SQLSRV versions:
https://learn.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server?view=sql-server-ver15.
Because of the way WAMPServer is configures, NTS extensions do not run.
So change your process just a little and use the Thread safe dll's instead.

Fatal error when updating joomla from 3.1.1 to 3.2.2

I updated my joomla site from 3.1.1 to 3.2.2 but now when I view my site I get
Fatal error: Call to a member function get() on a non-object in /home/studentw/public_html/plugins/system/remember/remember.php on line 96
I tried restoring my directory from a back up but I am still getting the error above. Line 96 of the remember.php file is:
$this->cookie_domain = $this->app->get('cookie_domain', '');
How can I fix this?
Google is your friend:
Rename your file remember.php to rememberBAK.php so it looks like this
/plugins/system/remember/rememberBAK.php
Find a copy of Joomla 3.1.15 and make a copy of the remember.php.
FTP the file to your folder
/plugins/system/remember/remember.php.
Now access your admin panel:
Go to Extensions -> Extension Manage -> Database.
Click Fix.
Now go to ftp, delete the remember.php that you uploaded and rename the original one to it's correct state.
Joomla updates do not update the database and this needs to be done manually.
For not developers, the above method is the simplest and quickest way
Source:Upgrade from 3.1 to 3.2 Fatal Error in Administrator Page

Cakephp giving Fatal error in my local computer

I have a projects in cakephp which is a big size projects.. It is running perfectly in another computer or in the server. But when I copy the files and database to my local computer then it shows the following error.
Fatal error: Maximum function nesting level of '100' reached, aborting! in D:\wamp\www\faceadz\cake\libs\debugger.php on line 248
Project is running in wamp server.
Please help me...
thanks
there might be 2 solution will work for you in you local machine configuration
1. A simple solution solved to your problem. you can just commented the:
"zend_extension = "d:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9.dll"
in your php.ini file. This extension was limiting the stack to 100 so I disabled it. The recursive function is now working as anticipated.
2. and
Assuming you're using xdebug, you can set your own limit with
ini_set('xdebug.max_nesting_level', $limit)
EDIT
Also it will help you
changes the file /etc/mysql/my.cnf parameter to something like that max_allowed_packet = 512M
Get sure you've got xdebug installed (use phpinfo()) and then change the file /etc/php5/fpm/php.ini adding or editing the line : xdebug.max_nesting_level=1000
Restart both services sudo service mysql restart sudo service php5-fpm restart
If it doesn't work you can still set those two parameters to false at /etc/php5/fpm/php.ini xdebug.remote_autostart=0 xdebug.remote_enable=0
hope it will help you,

Cakephp App class code printing on the page and spl_autoload_register error

I have moved the CakePHP installation from my development server to production server (Config file and htaccess updated).
The production server was using an older version of PHP and I have requested the host to upgrade it. After they upgraded the PHP version, the site printing the php code on the webpage (Class : /lib/Cake/core/app) .. Also it displaying a fatal error on the bottom of the page, its below
Fatal error: Uncaught exception 'LogicException' with message 'Passed
array does not specify an existing static method (class 'App' not
found)' in /xxxxxxx/lib/Cake/bootstrap.php:154 Stack trace: #0
/xxxxxxx/lib/Cake/bootstrap.php(154): spl_autoload_register(Array) #1
/xxxxxxx/app/webroot/index.php(92): include('/xxxxxxx/pu...') #2
{main} thrown in /xxxxxxx/lib/Cake/bootstrap.php on line 154
Please help..
Have you checked the PHP version has actually changed, did you check (with phpinfo())?
Apparently, CakePHP was unable to find or load the App class (/xxxx/lib/Cake/core/App.php).
It's possible that paths have changed since the update, however, (if you're using CakePHP 2.3.1) line 134 of that same file uses this to load that file:
require CAKE . 'Core' . DS . 'App.php';
If the file was not present or could not be loaded, the script should stop at that point.
To check if your paths are correct, try to debug that path;
echo CAKE . 'Core' . DS . 'App.php'; die();
If that path is correct (my guess it is, otherwise the require should have stopped the script already as mentioned above), there is something wrong with the content of the App.php file. Maybe something corrupted the file (partial upload?) or incorrect line-endings caused PHP to interpret it incorrectly.
If the page is really showing the complete source of the App class, it may be possible you're (inadvertendly) using php 'short opening tags' and this has been disabled in the new configuration <? which may be cause, for example if a space is there is a space after the <? - <? PHP
More on short opening tags can be found here:
Are PHP short tags acceptable to use?

Resources