# Class not found after authentication installed

**URL:** <https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977>\
**Category:** Need Help\
**Created:** [April 12, 2024, 8:26pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977 "2024-04-12T20:26:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 12, 2024, 8:26pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/1 "2024-04-12T20:26:21Z")

</div>

Following the quick start guide here:

[https://book.cakephp.org/authentication/3/en/index.html](https://book.cakephp.org/authentication/3/en/index.html)

I executed the command

`composer require cakephp/authentication`

and got some errors in the command prompt. Then I refreshed my localhost and got the same error as I got for a previous forum post:

Fatal error: Uncaught Error: Class “App\Application” not found in C:\xampp\htdocs\pp-5-0-6\webroot\index.php:34 Stack trace: #0 {main} thrown in C:\xampp\htdocs\pp-5-0-6\webroot\index.php on line 34

That was for the version 5.0.6 download. So I downloaded version 5.0.7 and tried again. I got errors in the command prompt again. I ran the command `composer require cakephp/authentication` again and got the error about Class “App\Application” not found again.

There were 7 error messages for version 5.0.6 and 5 error messages for version 5.0.7. The error messages were a variation of this:  
Failed to download cakephp/utility from dist: The zip extension and unzip/7z commands are both missing, skipping.  
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini  
Now trying to download from source

- Syncing cakephp/utility (5.0.7) into cache

Uncommented the zip extension in php.ini, stopped the server, and ran composer require cakephp/authentication again. The result was: Nothing to install, update or remove  
Refreshed my localhost and still got the error about Class “App\Application” not found.  
Also I changed the permissions on the src folder to full control.  
I am using XAMPP and PHP version 8.2.12.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 13, 2024, 12:54am UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/2 "2024-04-13T00:54:38Z")

</div>

I tried to disable the read-only attribute of the src folder but every time I applied the change, it switched back to read-only.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 14, 2024, 3:16pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/3 "2024-04-14T15:16:51Z")

</div>

I used the following command in the command prompt to clear the read only attribute:  
`attrib -R -S C:\xampp\htdocs\propot-v-5-0-6`  
When I used Windows File Explorer to view the folder properties, the read only attribute was still checked.  
Maybe you all use Linux like KevinPfeiffer does?  
I found another source that said to navigate to the folder you want to modify and use `attrib -r /s /d` in the command prompt but it didn’t work either. However it seemed to change something because it listed all the hidden .git files that it wasn’t able to reset.  
I also gave all users full control permissions.  
I’m not sure that read-only folder is the problem because before I installed the authentication, the default website was working.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 15, 2024, 2:48pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/4 "2024-04-15T14:48:31Z")

</div>

If you’re referring to the item shown in the screenshot below, then you’re wasting your time. All folders will display that “Read-only” item. It’s essentially meaningless. If you’re having a particular issue, the problem lies elsewhere, so please clarify what you’re trying to achieve.  
…  
But if you check the box, it is a command to tell Explorer to make all files in the folder read-only (it will ask for confirmation). It can also be unchecked to make all files in the folder not read-only. But it will always display a solid box!

SOURCE  
[https://answers.microsoft.com/en-us/windows/forum/all/how-to-remove-read-only-from-windows-10-folders/c1d2620b-01c2-47ea-91c2-2a753178b668#:~:text=Right-click%20on%20the%20folder,to%20all%20subfolders%20and%20files](https://answers.microsoft.com/en-us/windows/forum/all/how-to-remove-read-only-from-windows-10-folders/c1d2620b-01c2-47ea-91c2-2a753178b668#:~:text=Right%2Dclick%20on%20the%20folder,to%20all%20subfolders%20and%20files).

SEE ATTACHED SCREENSHOT

 ![2024-04-15](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/8/8fd4079fb293ba3ccd65da2570a2bdb6c98176c2.png)

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 15, 2024, 3:01pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/5 "2024-04-15T15:01:06Z")

</div>

![2024-04-15 (1)](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/b/b01a0bddc79ce6bd5d8de813072495cbe479c441.png)  
The screenshot shows that read-only has to have a checkmark. My folder looks like the one on the left so it’s not read-only.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 16, 2024, 5:55pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/6 "2024-04-16T17:55:01Z")

</div>

I installed 7z with `winget install 7zip.7zip` in the command line and ran `composer update` also in the command line and still the error persisted.  
If I switched to a Linux operating system, would someone be able to help me?

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 18, 2024, 12:17pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/7 "2024-04-18T12:17:59Z")

</div>

I just looked through your initial post and was wondering: Did you just execute

```auto
composer require cakephp/authentication

```

inside an empty folder or inside a CakePHP app?

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 18, 2024, 1:04pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/8 "2024-04-18T13:04:50Z")

</div>

I executed it inside the CakePHP app.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 18, 2024, 1:14pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/9 "2024-04-18T13:14:45Z")

</div>

Did the app work before you executed that command?

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 18, 2024, 1:18pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/10 "2024-04-18T13:18:41Z")

</div>

> [@makamo66](#):
>
> Class “App\Application” not found

This error indicates that not even the base cakephp/app installation worked so make sure this works before trying to setup authentication.

Also maybe try to follow my workshop where I go step by step:

[![](https://img.youtube.com/vi/EgN_iEVjQIA/maxresdefault.jpg "WORKSHOP - Authentication & Authorization by Kevin Pfeifer") ](https://www.youtube.com/watch?v=EgN_iEVjQIA)

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 18, 2024, 1:21pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/11 "2024-04-18T13:21:35Z")

</div>

Yes, the app worked before I installed authentication.  
I did a fresh installation of CakePHP again after installing 7zip and uncommenting the zip extension in php.ini. I ran `composer require "cakephp/authentication:^3.0"` and I didn’t get any error messages this time but the error about the missing class persisted.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 18, 2024, 1:42pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/12 "2024-04-18T13:42:19Z")

</div>

I’m watching the video now and I see that I didn’t do the following step:  
`composer create-project ---prefer-dist cakephp/app <project-name>`  
I don’t know that I need to execute the command above because I downloaded cakephp and installed it without using composer. I was able to get to the default home page after downloading it without composer.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 18, 2024, 1:43pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/13 "2024-04-18T13:43:14Z")

</div>

How did you manually download cakephp…

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 18, 2024, 1:46pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/14 "2024-04-18T13:46:57Z")

</div>

I downloaded it from this site;

> **[GitHub - cakephp/cakephp: CakePHP: The Rapid Development Framework for PHP -...](https://github.com/cakephp/cakephp)**
>
> CakePHP: The Rapid Development Framework for PHP - Official Repository - cakephp/cakephp

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 18, 2024, 1:51pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/15 "2024-04-18T13:51:43Z")

</div>

This is the core framework, not the app template. This of course can’t run standalone because it contains the parts to build the app template.

What you need (and you get when doing the installation correctly via composer create-project) is this repository: [GitHub - cakephp/app: CakePHP application template](https://github.com/cakephp/app)

You could have also just followed the installation guide [Installation - 4.x](https://book.cakephp.org/4/en/installation.html)

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 18, 2024, 1:57pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/16 "2024-04-18T13:57:03Z")

</div>

The readme on [GitHub - cakephp/cakephp: CakePHP: The Rapid Development Framework for PHP - Official Repository](https://github.com/cakephp/cakephp) even says:

> You can install CakePHP into your project using Composer. If you’re starting a new project, we recommend using the app skeleton as a starting point.

The

```auto
composer require cakephp/cakephp

```

is only meant for other, non-cakephp applications which need to have cakephp functionality added to them

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 18, 2024, 2:24pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/17 "2024-04-18T14:24:53Z")

</div>

I created the app using: `composer create-project --prefer-dist cakephp/app:~5.0 pp_new-version`

Then I ran:` composer require "cakephp/authentication:^3.0"`

Still get the error: Uncaught Error: Class “App\Application” not found  
Do I have to bake the app before the class can be found? I’m still watching the video.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 18, 2024, 2:30pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/18 "2024-04-18T14:30:31Z")

</div>

you are missing a crucial step… you need to go into the directory which is being created by the first command.

```auto
composer create-project --prefer-dist cakephp/app:~5.0 pp_new-version
cd pp_new-version
composer require "cakephp/authentication:^3.0"

```

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 18, 2024, 2:30pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/19 "2024-04-18T14:30:33Z")

</div>

When I run: `cake bake all users`  
I get the error:  
PHP Fatal error: Uncaught Error: Class “Cake\Console\CommandRunner” not found in C:\xampp\htdocs\pp\_new-version\bin\cake.php:9

When the app was being created, I answered yes to the following question:  
`Set Folder Permissions ? (Default to Y) [Y,n]? y`

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [April 18, 2024, 2:49pm UTC](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977/20 "2024-04-18T14:49:55Z")

</div>

I did go into the directory created by the create-project command before running the require command. I just didn’t say so in my post.

[Next page](https://discourse.cakephp.org/t/class-not-found-after-authentication-installed/11977.md?page=2)
