Undefined Index: doca
Posted by: HakunaM (194.135.202.---)
Date: November 29, 2019 02:09PM

Hi,

I am using WAMPServer for years. I am on version 3.1.3 actually. Suddenly I cannot open one of my local projects. The error I get on any page of the project (except of project index page)

Notice: Undefined index: doca in C:\Users\HakunaM\Documents\web\_projects\index.php on line 533

I get this error only if I try to open a certain project in browser. All other projects can be opened without any issue. I do not use virtual hosts. Any project is located just in subfolder of localhost. The only difference to other projects is: the project folder HAS contained a hyphen. The hyphen is removed, but there is still an error. And I cannot use the project any more.

Any help?
Thank you!
Hakuna

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: Otomatic (Moderator)
Date: November 29, 2019 03:15PM

Hi,

> Notice: Undefined index: doca in C:\Users\HakunaM\Documents\web\_projects\index.php on line 533
This is an error in your php script.
You want to use an array index, which does not exist (Undefined index).

> And I cannot use the project any more.
This is only a warning and does not block the execution of your script.
It is your responsibility to correct this error.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.41 - PHP 7.4.0/7.3.12/..../5.6.40 - MySQL 5.7.28 - MariaDB 10.4.11
Wampserver 3.2.0 64 bit - Apache 2.4.41 - PHP 7.4.0/7.3.12/..../5.6.40 - MySQL 5.7.28/8.0.18 - MariaDB 10.4.11
PhPMyadmin 4.9.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: RiggsFolly (Moderator)
Date: November 29, 2019 04:25PM

Hi

Did you change the version of PHP?

It could be that you did, and therefore will have the default setting applied. These will report errors.

There are 1,000,000 of lines of terrible code out there that just about works as long as you turn OFF error reporting.

However I would recommend fixing the bad code rather than just turning off error reporting.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: HakunaM (194.135.202.---)
Date: November 29, 2019 07:00PM

> Notice: Undefined index: doca in C:\Users\HakunaM\Documents\web\_projects\index.php on line 533
This is an error in your php script.

No, this is an error in WAMPServer code. These lines:

<dl class="content">
<dt>{$langues['versa']}</dt>
<dd>${apacheVersion}&nbsp;&nbsp;-&nbsp;<a href='http://{$langues[$doca_version]}'>Documentation</a></dd>

I have not written this index.php. It is delivered with WAMPServer and used as index page for the localhost.

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: RiggsFolly (Moderator)
Date: November 29, 2019 07:33PM

Can I suggest you upgrade to WAMPServer 3.2.0
The update will not effect any of your code or the versions of Apache/MySQL/PHP you are using

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: Otomatic (Moderator)
Date: November 29, 2019 07:34PM

Hi,

The installation of Wampserver, regardless of the version, does not put any files outside the installation folder wamp/ or wamp64/. No files are put in c:\user.

The only index.php file for all Wampserver installations is wamp/www/index.php or wamp64/www/index.php
There are also wamp\apps\adminer4.x.y\index.php, wamp\apps\phpmyadmin4.x.y\index.php and wamp\apps\phpsysinfo3.x.y\index.php

You have a big mess on your system for 'http://localhost' to go and get a file in c:\users\

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.41 - PHP 7.4.0/7.3.12/..../5.6.40 - MySQL 5.7.28 - MariaDB 10.4.11
Wampserver 3.2.0 64 bit - Apache 2.4.41 - PHP 7.4.0/7.3.12/..../5.6.40 - MySQL 5.7.28/8.0.18 - MariaDB 10.4.11
PhPMyadmin 4.9.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: HakunaM (194.135.202.---)
Date: November 29, 2019 07:45PM

RiggsFolly Wrote:
-------------------------------------------------------
> Can I suggest you upgrade to WAMPServer 3.2.0
> The update will not effect any of your code or the
> versions of Apache/MySQL/PHP you are using

Yes, I am going to upgrade.

Otomatic Wrote:
-------------------------------------------------------
> The installation of Wampserver, regardless of the
> version, does not put any files outside the
> installation folder wamp/ or wamp64/. No files are
> put in c:\user.
>
> The only index.php file for all Wampserver
> installations is wamp/www/index.php or
> wamp64/www/index.php
> There are also wamp\apps\adminer4.x.y\index.php,
> wamp\apps\phpmyadmin4.x.y\index.php and
> wamp\apps\phpsysinfo3.x.y\index.php
>
> You have a big mess on your system for
> 'http://localhost' to go and get a file in
> c:\users\

I have only changed the DocumentRoot for the WAMPServer. I have done it for years as I do not want to have my projects files in c:\wamp, I want to have have them in my Documents. It has worked and works for all my projects (over 10) without issues. This is the first project where I have this weird issue.

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: HakunaM (194.135.202.---)
Date: November 30, 2019 09:06AM

I have figured it out. It was a crappy .htaccess in the project that has caused the error. I could solve the error by installing XAMPP. The error output was very clear there. I have no clue why WAMPServer has given this weird error.

Changing DocumentRoot was not a problem. I has always worked for me without issues.

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: Otomatic (Moderator)
Date: November 30, 2019 10:01AM

Hi,

> I have no clue why WAMPServer has given this weird error.
Because you moved the Wampserver homepage. You must not modify wamp(64)/www/ and its content.
It's like moving one of the Windows folders and then saying, "Windows doesn't work anymore!"
On the other hand, you can put your own local sites almost anywhere you want, just use VirtualHost.

> Changing DocumentRoot was not a problem. I has always worked for me without issues.
Just because it worked for a while doesn't mean it was the right solution.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.41 - PHP 7.4.0/7.3.12/..../5.6.40 - MySQL 5.7.28 - MariaDB 10.4.11
Wampserver 3.2.0 64 bit - Apache 2.4.41 - PHP 7.4.0/7.3.12/..../5.6.40 - MySQL 5.7.28/8.0.18 - MariaDB 10.4.11
PhPMyadmin 4.9.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: HakunaM (194.135.202.---)
Date: November 30, 2019 01:47PM

Thanks, I did not know that DocumentRoot may not be changed in WAMP. It is just a setting. Your comparison with Windows folder is false. I CAN move my Windows Documents folder in any other location, e. g. on the other hard disk (what I indeed have done). And it still works.

I have moved DocumentRoot as I have very large projects and have not enough disk space on C:/ for them. All my files and projects and documents are on other disk. This other disk is backuped every day to the cloud. This is how I work.

I have tried to work with virtial hosts in the past. The setup was some years ago pretty tricky and took a long time. Probably something has changed in new versions, I have not tried it again as I am happy with subfolder solution. One subfolder in DocumentRoot = one project.

I have tried XAMPP and it looks like changing DocumentRoot in XAMPP is allowed and common. So I stay with XAMPP right now.

Options: ReplyQuote
Re: Undefined Index: doca
Posted by: RiggsFolly (Moderator)
Date: November 30, 2019 03:51PM

It is probably best smiling smiley

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.