PHP Error encountered in XAMPP - php

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 .

Related

error: Cannot access offset of type string on string

I'm helping a client with getting their website ready for PHP8. After doing the update to the latest Joomla and making sure the template is updated, it runs fine on PHP8. I do however get the following error only on one page. The page where you have to create a new user:
Error: Failed opening required
'/usr/www/users/kznden/libraries/joomla/document/html/renderer/head.php' (include_path='.:/usr/share/php'): Cannot access offset of type string on string
I know this path doesnt exist anymore but how can I get rid of this error and the page working again? I opened the error.php file and believe the error is related to that file. If I'm wrong, please correct me. Specifically the following code:
$doc->setTitle($this->error->getCode() . ' - '.$this->title);
require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');
$header_renderer = new JDocumentRendererHead($doc);
$header_contents = $header_renderer->render(null);
Removing
require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');
doesn't seem to fix the issue.
enter image description here

Joomla : how to fix "Undefined property: AriDocsViewerContentPlugin::$stripUSC"?

I try to install the ARI Docs Viewer plugin of Joomla in localhost and I always have the following error: " Undefined property: AriDocsViewerContentPlugin::$stripUSC "
However, all the files to be displayed are all present in the local server.
When I disable the plugin, there is no error on the site and the document does not display.
I’ve already commented the next code tip and the error goes away but the document still does not appear.
if ($this->stripUSC) { // Alternatively:
preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xE2\xAF\x91", $source) but
it'd be slower. $source = $this->stripUSC($source); }
Does someone here already had this error ?
Thanks a lot!!!

undefined constant DIR_LOG Error with Opencart

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.

CodeIgniter Strange URL Routing Issue

Ok. So I changed the routing by adding this rule in the routes.php file:
$route['tools/(:any)'] = "b/view/$1";
However, when I visit http://mywebsite.com/tools/toolid, I get the following error:
A PHP ERROR WAS ENCOUNTERED
SEVERITY: NOTICE
MESSAGE: TRYING TO GET PROPERTY OF NON-OBJECT
FILENAME: VIEWS/LISTING_PAGE.PHP
LINE NUMBER: 64
So the code on line 64 in the LISTING_PAGE.PHP file is:
echo $categoryinfo->name;
The LISTING_PAGE.PHP is a view which is loaded by the code in the B class, specifically this line:
$this->load->view("listing_page", $data);
Now, the strange thing is, if I change the routing rule in routes.php to:
$route['tools/id/(:any)'] = "b/view/$1"; //I added an id 'section'
Then the code works without error.
The code also works perfectly if I access http://mywebsite.com/b/view/toolid.
So it appears that if there is more than one 'section' (tools/id) then the code works perfectly, if there is only one 'section'(tools/) then there is that non-object error.
Does anyone know what may cause this issue?
#splash58 is right
You should put:
echo '<pre>', var_dump($category);exit;
on very first line of view file just after opening php tag and see what have you got.

Zend FlashMessenger

Having an issue, don't know why this is happening:
In the first instance, everything works just fine, the message is set and it displays:
$this->_helper->FlashMessenger()
->setNamespace('success')
->addMessage('Success!')
->addMessage('User ' . $this->_request->getPost('user_name') . ' sucessfully added!');
$this->redirect('users/index');
However, in this instance, it fails with the message:
Warning: Missing argument 1 for
Zend_Controller_Action_Helper_FlashMessenger::direct()
$this->_helper->FlashMessenger()
->setNamespace('error')
->addMessage('Failure!')
->addMessage('User was not added, please see errors below.');
Try changing your code to:
$this->_helper->getHelper('FlashMessenger')
->setNamespace('error')
->addMessage('Failure!')
->addMessage('User was not added, please see errors below.');

Categories