After migrating to PHP7.2 from PHP5.5 , my PHP scripts are not getting executed however phpinfo() is loading fine . I have installed php from source code .
I have enabled display_errors setting and it showing the following messages
[03-Oct-2018 16:32:12 UTC] PHP Warning: Creating default object from empty value in config.php on line 163
[03-Oct-2018 16:32:12 UTC] PHP Notice: Array to string conversion in get.php on line 25
[03-Oct-2018 16:32:12 UTC] PHP Notice: Undefined property: stdClass::$Array in get.php on line 25
But these are warnings and notices .
Am I missing some configuration to make the code work ?
On the first error in config.php file, you probably should instantiate a new stdClass() like the example below:
$var = new stdClass()
and then assign a value to its properties.
On the second error, you must have assigned the var as an array and then trying to echo that var
Without seeing the code I think its all the help I could give you
Related
I am getting the error in my debug log -
[22-Mar-2019 12:25:33 UTC] PHP Notice: WC_Cart::get_cart_url is <strong>deprecated</strong> since version 2.5! Use wc_get_cart_url instead. in /home/176860.cloudwaysapps.com/tzshvjkjbz/public_html/wp-includes/functions.php on line 4329
What could be causing this error? The line of code specified aove is inside a comment which says:
* A return value of `1` means the file path contains directory traversal.
So I have no idea where to go from this error message. I've also searched my entire directory for WC_Cart::get_cart_url and it is not being used anywhere.
I can't save the header menu on my site in WordPress - it keeps failing with a 500 Internal Server Error. I've tried updating my .htaccess file, and the php memory limit has been set to 128M. The core files are recently updated (4.8), and everything else in the site saves fine (pages, other menus, ext.) It's just the header menu (which has 60+ items) that gets the error.
EDIT
The debug log after trying to save the menu contains no fatal errors. Lots of PHP Notices for deprecated stuff though. Here's a sample:
[16-Aug-2017 17:23:21 UTC] PHP Notice: Undefined variable: th_query in /var/www/vhosts/mysite.com/mysubsite.com/wp-content/themes/mysitetheme/functions.php on line 377
[16-Aug-2017 17:23:21 UTC] PHP Notice: Trying to get property of non-object in /var/www/vhosts/mysite.com/mysubsite.com/wp-content/themes/mysitetheme/functions.php on line 377
[16-Aug-2017 17:23:23 UTC] PHP Notice: The called constructor method for WP_Widget in WDG_SpecialRecentPostsPro is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /var/www/vhosts/mysite.com/mysubsite.com/wp-includes/functions.php on line 3894
[16-Aug-2017 17:30:27 UTC] PHP Notice: Use of undefined constant url - assumed 'url' in /var/www/vhosts/mysite.com/mysubsite.com/wp-content/themes/mysitetheme/header.php on line 339
The 500 error still only shows up when trying to save the header menu in Appearance > Menus.
I found this article with similar issue:
WordPress is not limiting the number of menus you can have. Your web
hosting server is.There are limitations on the POST max variables which is limiting the
large number of entries being saved.
So try to increase the following PHP settings in php.ini to something like shown below:
post.max_vars = 5000
request.max_vars = 5000
I am new to CakePHP framework (more of the Yii guy), so my question might look stupid to someone, however I am stuck with this problem all day. I am trying to create console command to execute in shell, however there is something wrong with Session initialization (?) I constantly get error:
PHP Notice: Undefined index: cookie in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php on line 485
PHP Notice: Undefined index: timeout in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php on line 491
PHP Warning: ini_set(): session.name cannot be a numeric or empty '' in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php on line 500
PHP Fatal error: Uncaught exception 'CakeSessionException' with message 'Unable to configure the session, setting session.name failed.' in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php:501
Why cakephp doesn't load core.php config values? In my config I set:
Configure::write('Session', array(
'defaults' => 'php'
));
Configure::write('Session.cookie', 'PROJECT');
Configure::write('Session.timeout', '28800');
CakePHP version 2.4.7
Ok, so if anyone will come to this problem, there is thing to notice. In windows you can't run cake command... Well you can, but notice line in cake.bat file:
:: In order for this script to work as intended, the cake\console\ folder must be in your PATH
or run php cake.php...
I just copied my htdocs folder to anther pc with a clean new xampp and made a copy of the database too. When i try to access the site the php error log shows this error:
[13-Jun-2014 18:34:07 Europe/Berlin] PHP Warning: array_merge() [http://php.net/function.array-merge'>function.array-merge]: Argument #1 is not an array in C:\xampp\htdocs\website\View\Helper\MenuHelper.php on line 74
[13-Jun-2014 18:34:07 Europe/Berlin] PHP Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\website\View\Helper\MenuHelper.php on line 85
My other page which was in the same htdocs folder is running fine (it isn't using cakephp). Any ideas what could have happened? Any idea how to find out where this is called since it seems to be a cakephp-Helper?
EDIT:
Seems I missed 2 lines in the php_error.log:
PHP Notice: Undefined variable: login in C:\xampp\htdocs\website\View\Layouts\default.ctp on line 2
PHP Notice: Undefined variable: menu in C:\xampp\htdocs\website\View\Layouts\default.ctp on line 82
some see me the same, that's what I did, just copy the folder app, after creates a new project and copy the app folder and replaces the app folder. and shuld be found. I look the reason of the problem and just read about the cookies and cache. And the option that a give you is more easy.
The problem was that I was using a new version of xampp but did not update cakephp to the newest version. After doing so everything worked fine.
I moved a wordpress site from a shared environment to a dedicated virtual server on media temple. I got a blank page at first, but I'm getting these weird errors when I turn error reporting on.
How do I fix it?
Site URL: https://64.207.147.116/
Error Messages
Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/herondance.org/httpdocs/wp-settings.php on line 219 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/herondance.org/httpdocs/wp-settings.php on line 234 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/herondance.org/httpdocs/wp-settings.php on line 241 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/herondance.org/httpdocs/wp-settings.php on line 248 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/herondance.org/httpdocs/wp-settings.php on line 273 Deprecated: Function set_magic_quotes_runtime() is deprecated in /var/www/vhosts/herondance.org/httpdocs/wp-settings.php on line 27 Notice: Undefined variable: wp_version in /var/www/vhosts/herondance.org/httpdocs/wp-content/plugins/1-click-retweetsharelike/la-click-and-share-utility-fns.php on line 4 Notice: Undefined index: PATH_INFO in /var/www/vhosts/herondance.org/httpdocs/wp-content/plugins/blip-slideshow/blip.php on line 723 Notice: register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. (This message was added in version 3.1.) in /var/www/vhosts/herondance.org/httpdocs/wp-includes/functions.php on line 3422
Check what version of WordPress and PHP you are using. It looks like you might be using a really old version of WordPress that uses features of PHP that are no longer supported. If that is the case I would recommend upgrading WordPress to the latest version.
A stop gap measure would be to disable these warnings by putting the following line of code at the beginning of the index.php file in your web root.
error_reporting(E_ALL & ~E_DEPRECATED);
This will prevent those messages from being displayed, but you really shouldn't ignore them.
Solution: I went into the database with phpmyadmin and disabled all plugins. I then installed them one by one in the backend and presto. Live, working site. Thanks for all the responses though.