Error in MenuHelper after copying htdocs folder to other server - 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.

Related

How can I get my Joomla 3 to work correctly?

I need to do a very simple task for school in Joomla 3.10.3 but it doesn't seem to work correctly.
I'm trying to create modules but I can't, it gives me those errors:
Undefined property: Joomla\CMS\Object\CMSObject::$checked_out in C:\xampp\htdocs\Joomla3\administrator\components\com_modules\views\module\view.html.php on line 62
Warning: Undefined property: Joomla\CMS\Object\CMSObject::$position in C:\xampp\htdocs\Joomla3\administrator\components\com_modules\views\module\tmpl\edit_positions.php on line 17
Warning: Undefined property: Joomla\CMS\Object\CMSObject::$position in C:\xampp\htdocs\Joomla3\administrator\components\com_modules\views\module\tmpl\edit_positions.php on line 27
I've tried going into the files, but it looks like gibberish and I don't think I can fix it from there.
Maybe it's something with Joomla 3 being older and me having PHP version 8.1.10, dunno.
I think it is almost certainly the template that you are using is not compatible with PHP 8.1. A lot of the older Joomla 3 templates will throw errors. If you can switch to PHP 7.4.x I expect the problems will stop

Can't get $_SERVER to run properly

I'm trying to execute "opendir" to understand how it works & use it in a recursive page call (I get wrong directories using .. & .).
My folder is constructed as follows:
C:\xampp\htdocs\Ask_Alansky
C:\xampp\htdocs\ is what comes in the XAMPP package, & Ask_Alansky is the folder in which I'm working.
The issue is simply that I cannot get a opendir () to work & open the directory. I'm not sure if I'm misunderstanding the concept, but I expect the code to simply open the folder "Ask_Alansky" & show me the files.
My code is:
<?php
opendir($_SERVER['C:/xampp/htdocs/Ask_Alansky'] . '/index.php');
?>
I get:
Notice: Undefined index: C:/xampp/htdocs/Ask_Alansky in
C:\xampp\htdocs\Ask_Alansky\php_main\Testing.php on line 14
Warning: opendir(/index.php,/index.php): The system cannot find the file specified. (code: 2) in
C:\xampp\htdocs\Ask_Alansky\php_main\Testing.php on line 14
Warning: opendir(/index.php): failed to open dir: No such file or directory in
C:\xampp\htdocs\Ask_Alansky\php_main\Testing.php on line 14
What I'm doing wrong?
$_SERVER is an associative array that contains multiple server information. Therefore, there is not such key C:/xampp/htdocs/Ask_Alansky. If you wish to access the current directory, use getcwd() instead. It is also not a good idea to use absolute path to your file, this will cause a problem when you migrate your app to another server.

Unable to read the "../.dev.env" environment file in Dotenv.php:symfony

I want To run a symfony project in my computer but I get all times errors , and now I get this error and i didn't find any solution for my problem
Problem Failed to parse output as xml: Error on line 2: Content is not
allowed in prolog.. Command C:\xampp\php\php.exe
C:\xampp\htdocs\buzzaka\bin\console list --format=xml Output
Fatal error: Uncaught
Symfony\Component\Dotenv\Exception\PathException: Unable to read the
"C:\xampp\htdocs\buzzaka\bin/../.dev.env" environment file. in
C:\xampp\htdocs\buzzaka\vendor\symfony\dotenv\Dotenv.php:466 Stack
trace:
0 C:\xampp\htdocs\buzzaka\vendor\symfony\dotenv\Dotenv.php(51): Symfony\Component\Dotenv\Dotenv->doLoad(false, Array)
1 C:\xampp\htdocs\buzzaka\bin\console(38): Symfony\Component\Dotenv\Dotenv->load('C:\xampp\htdocs...')
2 {main} thrown in C:\xampp\htdocs\buzzaka\vendor\symfony\dotenv\Dotenv.php on line 466
If u move your file from the folder where it was created symfony will keep looking for it on this folder, i've went on autoload_runtime and changed on $runtime variable where the project is, just worked for me, lets see on the last composer dump what just happens haha
The error is quite explicit, do you have a file C:\xampp\htdocs\buzzaka\bin/../.dev.env ?
Well, you need to create one. As announced a little while ago, Symfony will now require a .env file per environment. As you are running your command in the dev environment, you need to create a .dev.env file.

How to generate a sitemap for my MediaWiki wiki family?

I am well aware of the existence of the maintenance script generateSitemap.php. I got a unique multi-language wiki setup though. That is i guess why it does not really work.
So after i do php -f generateSitemap.php i get this error:
PHP Warning: file_get_contents(/var/www/mySite/_inc/../.ENVIRONMENT): failed to open stream: No such file or directory in /var/www/mySite/_inc/settings.inc.php on line 12
PHP Notice: Undefined index: HTTP_HOST in /var/www/mySite/wiki/LocalSettings.php on line 174
<br />
<b>Notice</b>: Undefined index: HTTP_HOST in <b>/var/www/mySite/wiki/LocalSettings.php</b> on line <b>174</b><br />
DB connection error: Connection refused (127.0.0.1:8889)
I got ONE single LocalSettings.php and only ONE database using prefixes. It changes depending on the user language like or what he/she selects so:
de.mySite.org
en.mySite.org
es.mySite.org
and so forth.
How can i run my maintenance script and get my sitemap? Any ideas are welcome.
Edit:
I tried setting different parameters as shown here. I did not get it right yet.
Edit2:
I plan to use a Cron to update sitemap automatically via a bash command.

Problem with php mailer

am getting these errors while running php mailer. What could be the problem
MAMP/htdocs/practice/email/email.php on line 2
[06-Jun-2011 09:53:40] PHP Notice: Undefined variable: from in /Applications/MAMP/htdocs/practice/phpmailer/phpmailer.inc.php on line 259
[06-Jun-2011 09:53:40] PHP Notice: Undefined variable: Encoding in /Applications/MAMP/htdocs/practice/phpmailer/phpmailer.inc.php on line 271
[06-Jun-2011 09:53:40] PHP Fatal error: Cannot access empty property in /Applications/MAMP/htdocs/practice/phpmailer/phpmailer.inc.php on line 271
Please be sure that you are using the latest release of PHPMailer, 5.1. There is no such file "phpmailer.inc.php" in that release, which implies that the code you're using is either entirely incorrect or horribly obsolete. Indeed, the only reference I could find to that file is from a release dating back to 2003.
You might also want to consider using a more modern mailing library instead, like SwiftMailer.
The download link on PHPMailer's website is wrong. Instead of downloading PHPMailer v. 5+ you downloaded PHPMailer 4. Edit the download link and change the # 4 to 5. Then you get the correct version.

Categories