# Error HTTP 403 and 404 after trying a workaround to make occ work

**URL:** <https://help.nextcloud.com/t/error-http-403-and-404-after-trying-a-workaround-to-make-occ-work/214955>\
**Category:** ℹ️ Support\
**Created:** [January 14, 2025, 4:09pm UTC](https://help.nextcloud.com/t/error-http-403-and-404-after-trying-a-workaround-to-make-occ-work/214955 "2025-01-14T16:09:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stemy2](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stemy2/32/6155_2.png) [@stemy2](https://help.nextcloud.com/u/stemy2)\
**Post date:** [January 14, 2025, 4:09pm UTC](https://help.nextcloud.com/t/error-http-403-and-404-after-trying-a-workaround-to-make-occ-work/214955/1 "2025-01-14T16:09:04Z")

</div>

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. ❤

## The Basics

- Nextcloud Server version _(e.g., 29.x.x)_:
  - **30**

- Operating system and version _(e.g., Ubuntu 24.04)_:
  - Debian 12

- Web server and version _(e.g, Apache 2.4.25)_:
  - NGINX 1.22.1-9

- Reverse proxy and version \_(e.g. nginx 1.27.2)
  - NGINX 1.22.1-9

- PHP version _(e.g, 8.3)_:
  - 8.3

- Is this the first time you’ve seen this error? (Yes / No):
  - no

- When did this problem seem to first start?
  - The first time i launched the command

- Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.)_
  - Installation script

- Are you using CloudfIare, mod\_security, or similar? _(Yes / No)_
  - no

### Summary of the issue you are facing:

I’d like to use the occ command to perform some maintenance, but i’m facing error messages.  
`Could not open input file: occ`  
I tried a workaround mentioned [here](https://help.nextcloud.com/t/could-not-open-input-file-occ/12604) and typed the command `chmod 744 /var/www/nextcloud`, but it’s getting worse: now i have HTTP 403 and 404 errors. How to fix this ?

### Steps to replicate it (hint: details matter!):

1. Try a command implying occ
2. `chmod 744 /var/www/nextcloud`

### Log entries

#### Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the _Copy raw_ option from _Administration settings-\>Logging_ screen or from your `nextcloud.log` located in your data directory). Feel free to use a pastebin/gist service if necessary.

```auto
PASTE HERE

```

#### Web Browser

---

<div class="post-metadata">

**Author:** ![Vincent\_Stans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vincent_stans/32/17415_2.png) [@Vincent\_Stans](https://help.nextcloud.com/u/Vincent_Stans)\
**Post date:** [January 14, 2025, 5:10pm UTC](https://help.nextcloud.com/t/error-http-403-and-404-after-trying-a-workaround-to-make-occ-work/214955/2 "2025-01-14T17:10:10Z")

</div>

first fix your permissions:  
undo your chmod 744 this is should be best at 750 drwxr-x—

> [@stemy2](#):
>
> When did this problem seem to first start?
> 
> - The first time i launched the command

How did you run the command?

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/6_22734026db12803ebb3e059622ac3534.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [January 14, 2025, 7:07pm UTC](https://help.nextcloud.com/t/error-http-403-and-404-after-trying-a-workaround-to-make-occ-work/214955/3 "2025-01-14T19:07:43Z")

</div>

> [@stemy2](#):
>
> I tried a workaround mentioned [here](https://help.nextcloud.com/t/could-not-open-input-file-occ/12604) and typed the command `chmod 744 /var/www/nextcloud`,

And for the record, that’s not what that linked post says to do. 😉

The `chmod` target is `occ` not the folder.

You might also find the chapter covering `occ` of interest: [Admin Manual: Using the `occ` command](https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html)

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [April 14, 2025, 7:08pm UTC](https://help.nextcloud.com/t/error-http-403-and-404-after-trying-a-workaround-to-make-occ-work/214955/4 "2025-04-14T19:08:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
