all of a sudden I am getting the following error which prevents me from logging in to my admin and it is also showing on header of the store front
Notice: Use of undefined constant DIR_LOG - assumed 'DIR_LOG' in /home/user/public_html/system/library/openbay/ebay.php on line 150Notice: Use of undefined constant DIR_LOG - assumed 'DIR_LOG' in /home/user/public_html/system/library/openbay/ebay.php on line 150Warning: rename(DIR_LOGebaylog.log,DIR_LOG_ebaylog_2015-10-25_00-23-22.log): No such file or directory in /home/user/public_html/system/library/openbay/ebay.php on line 150Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/admin/index.php:84) in /home/user/public_html/system/library/response.php on line 12
Here is the code in /home/user/public_html/system/library/openbay/ebay.php on line 150
rename(DIR_LOG . 'ebaylog.log', DIR_LOG . '_ebaylog_' . date('Y-m-d_H-i-s') . '.log');
and I checked and DIR_LOG is defined correctly in config.php
Any help to identify and fix the issue is highly appreciated
Just fixed it by adding
define('DIR_LOG', '/home/schwann/public_html/system/logs/');
to /home/user/public_html/admin/config.php
Opencart has
define('DIR_LOGS', '/home/schwann/public_html/system/logs/');
by default but it looks like openbay pro has a bug and is using DIR_LOG instead of DIR_LOGS by defining LOG and LOGS both the problem will be solved.
Related
The company I work for are using Customer Area for one of our clients and everything has been great until recently. When a private file is tried to be downloaded we get several error messages appear:
Notice: Undefined index: force-download in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php on line 1029
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 945
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 952
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 955
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 956
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 959
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 960
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 961
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php:1029) in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-default-handlers.class.php on line 989
When trying to reset the plugin settings or database through the plugin we also get the error:
Notice: Undefined index: cuar_admin_theme_url in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-classes/settings.class.php on line 674
Warning: Cannot modify header information - headers already sent by (output started at /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-classes/settings.class.php:674) in /Users/mathew/Websites/mamp/portal-test/wp-includes/pluggable.php on line 1216
We are using our own WordPress theme which we have removed all customised WP Customer Area templates, and even switched themes to TwentySeventeen but the errors still appear. As well as switching themes we have tried uninstalling and reinstalling the plugin.
So we decided to create a new blank WordPress environment and test it there and re-download the plugin so it is new. The download button then began to work but when testing for a second/third time the errors returned.
As previously mentioned the plugin was working perfectly up until being discovered yesterday. We haven’t edited any of the core files only the template files which we did by following the instructions of WP Customer Area. The site is running WordPress 4.9.1 and plugin version is 7.4.5. However, we have tried with Wordpress 4.9 and plugin versions 7.4.0, 7.3.0.
If anyone can help with this it would be greatly appreciated. Thank you for taking the time to read my message.
Thanks
I got in touch with the people at WP Customer Area and they are looking into the issue as it seems to be a bug in the plugin. But in the meantime they have given me some code to stop the errors by replacing:
!isset($_GET['force-download']) && $_GET['force-download'] != 1)
On line 1029 in customer-area/src/php/core-addons/private-file/private-file-addon.class.php.
with the line:
if ( !isset($_GET['force-download']) || (isset($_GET['force-download']) && $_GET['force-download'] !== 1))
This has helped me with the errors and hope it helps you guys as well.
Unfortunately you will probably need to chase this bug through a lot of code, but the general fix is to identify situations where an array key is assumed to be existing and fix it with some code.
The error tells you where to start:
Notice: Undefined index: force-download in /Users/mathew/Websites/mamp/portal-test/wp-content/plugins/customer-area/src/php/core-addons/private-file/private-file-addon.class.php on line 1029
From the index name, force-download I would guess this is the value of a checkbox on an HTML form. When unchecked, no value is passed via HTTP POST yet the script is looking for this in $_POST (guessing here).
The best advice I can give is to fix the instances of this with something like:
<?PHP
if( array_key_exists( 'force-download', $_POST ) && $_POST['force-download'] )
{
// do something
}
?>
What I do for my forms:
In order to always have a $_POST value, I output a hidden form field with a zero value before the checkbox field. Then the checkbox field has a value of 1. That way the checkbox field, if checked, passes '1' via $_POST and my if statements just work without having to always be constantly be checking for empty, array_key_exists, etc.
My WordPress Admin Dashboard is experiencing an issue which I have never encountered before. I have not made any updates/changes on WordPress and any plugins. Yet, suddenly my WordPress Admin Dashboard has become like the attached image below.
What I have tried so far to fix this issue:
(1) Increased the WP_MEMORY_LIMIT but it did not worked out
(2) Tried to change wp-admin\includes\screen.php on line 706:
from <?php echo self::$this->_help_sidebar; ?>
to <?php echo $this->_help_sidebar; ?>
But my screen.php file has less than 300 lines of code and does not contain <?php echo self::$this->_help_sidebar; ?> in it. So I cannot change it.
(3) Disabled all plugins(10) by renaming the "plugins" folder and it did solved the blank page issue.
(4) I have set WP_DEBUG to TRUE and got the following messages:
Undefined property: wpdb::$connect_errno in /local/www/html/xxxxx/wp-includes/wp-db.php on line 684 Notice: Undefined property: wpdb::$connect_errno in /local/www/html/xxxxx/wp-includes/wp-db.php on line 684 Notice: The called constructor method for WP_Widget in WPAC_Nav_Menu_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /local/www/html/xxxxx/wp-includes/functions.php on line 3764 Notice: The called constructor method for WP_Widget in Genesis_Featured_Post_with_title is deprecated since version 4.3.0! Use
__construct()
instead. in /local/www/html/xxxxx/wp-includes/functions.php on line 3764 Notice: Constant FORCE_SSL_ADMIN already defined in /local/www/html/xxxxx/wp-config.php
(5) Disabled the plugins(10) one by one to find out which plugin was the culprit. Interesting enough is that whichever plugin I disabled the blank page issues was still solved . This made it difficult for me to isolate which plugin was the culprit. I might be totally wrong thinking that the plugins may be causing this blank page issues. Currently, I have no idea how to solve/approach this issue and why this is happening.
Any help would be appreciated very much!
I am working with opencart and I am learning right now.
When I add discount price in product and save it then I received notice like :
Notice: Undefined index: points in /home/eyelens/public_html/admin/model/catalog/product.php on line 131Notice: Undefined index: points in /home/eyelens/public_html/admin/model/catalog/product.php on line 177Notice: Undefined index: weight in /home/eyelens/public_html/admin/model/catalog/product.php on line 177Notice: Undefined index: weight_prefix in /home/eyelens/public_html/admin/model/catalog/product.php on line 177Warning: Cannot modify header information - headers already sent by (output started at /home/eyelens/public_html/admin/index.php:80) in /home/eyelens/public_html/system/library/response.php on line 12
Here, I got error because my array is full so it can not return point and weight therefor it gives an error. So how can I increase array size ?
Undefined index : Even though php does not need variables to be declared first you must have some values in it before using a variable. So it is recommended that you should initialise the variables or use isset(variablename) before using the variable.
Inorder to solve headers already sent error, you should not print any output before using functions that modify headers like header() session_start()
I have write below two variable in php.ini file
max_input_vars = 30000;
max_post_size = 30000;
and its working perfect.
I am using this code to implement a 'Treasure Hunt' . I have very little idea about the code that I am working with . One thing I am trying to do is make the code work with XAMPP on my PC . I was able to fix the database errors that I was encountering whenever I tried to navigate to localhost/treasurehunt/admin/login . What I did was this -
Set a root username and password for the entire 'thing'
(using localhost/security/xamppsecurity.php)
Edited the database.php file with appropriate username and password (That of the 'root') .
Created a database (using localhost/phpmyadmin) and changed database.php accordingly .
Now , when I try to navigate to localhost/treasurehunt/admin/login page , I am getting an error . I tried fixing this from last two days (by searching on various forums) , but was not of "much" help . The error is as follows -
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$agent
Filename: core/Loader.php(829) : eval()'d code
Line Number: 9
Fatal error: Call to a member function is_mobile() on a non-object in
C:\xampp-portable\htdocs\treasurehunt\system\core\Loader.php(829) : eval()'d code on
line 9
Is there any way I can fix this . Please tell me which all code samples from which files do you guys need to understand the problem precisely . I will add the code to my question .
Thanks in advance .
There is one php project made in fully core php. Now my work is to change some style issues. So I just downloaded all the files with the database. I just configured all the database name,username,password over my localhost(LAMP). When I browsed the page it is showing the page but there are some errors with it. It is showing error like
Notice: Undefined variable: _session_register in path to the folder/session.php on line 8
Notice: Undefined variable: _session_register in path to the folder/session.php on line 9
Notice: Undefined variable: _session_register in path to the folder/session.php on line 10
Notice: Undefined variable: _session_register in path to the folder/session.php on line 11
Notice: Undefined variable: _session_register in path to the folder/session.php on line 12
Notice: Undefined variable: _session_register in path to the folder/session.php on line 13
The code for the session.php is like this
<?php
$_SESSION['example']="yes";
ini_set("url_rewriter.tags","");
ini_set('session.use_trans_sid', 0);
ini_set("session.cookie_domain", ".localhost");
session_start();
ob_start();
$_session_register["easb2b_username"];
$_session_register["easb2b_userid"];
$_session_register["easb2b_memtype"];
$_session_register["easb2b_adv_id"];
$_session_register["easb2b_adv_email"];
$_session_register["lang"];
?>
So can someone kindly tell me how to solve this issue. The project has around thousand of files. So its really hard to go through all the files and check them. Any help and suggestions will be really appreciable. Thanks....
<?php
// Use of session_register() is deprecated
$new_sessionvar = "Some value.";
session_register("new_sessionvar");
But you can still use
session_start();
$_SESSION['new_sessionvar'] = "Some value"
In order to use it you need to turn on register_global in php.ini
Note that I have the session_start() function right above initialization. In your code you may want to add it at the top of your script to prevent the Headers already sent by PHP message.