<p>I’m trying to move a local Craft 3 site to a local server (hosted on 1&amp;1).</p>

<p>The website itself runs fine, but for some reason I can only access the admin panel when the <code>web/cpresources</code> folder has permissions set to <code>777</code>, which I obviously don’t want. (<strong>EDIT</strong>: It also seems to work with <code>755</code>, but the folder probably shouldn't be executable by everone, right?)</p>

<p>All other folders where Craft needs write access are set to <code>744</code>, as per the install instructions, and as long as <code>web/cpresoures</code> are <code>755</code>, everything else seems to work fine.</p>

<p>Does anyone have an idea what can be the issue and a possible solution here?</p>

<p>Unfortunately I don’t know which user PHP runs under, but as a standard web hosting setup, I would guess it should be able to write to the file system without open access for everyone, and again everything else seems to be working like normal.</p>

<p><strong>UPDATE</strong>:</p>

<p>It only</p>

<p>I managed to get the user by running this code:</p>

<pre><code>$username = posix_getpwuid(posix_geteuid())['name'];
$echo $username;
</code></pre>

<p>The reported user is the same as my account, meaning php should run as the same user that owns the files.</p>

CC BY-SA 4.0
2018-07-22T19:42:45.627Z
You need to determine the user/group php runs as, because that's what needs write perms for the web/cpresources folder. More here: https://nystudio107.com/blog/hardening-craft-cms-permissions
andrew.welch
CC BY-SA 4.0
2018-07-23T00:06:32.007Z
Yes, I realise that. Unfortunately I can't really determine what the php user runs as, or what group it's in, as I'm on a shared hosting with no access to the php installation itself. But I've had a running version of Craft 2 on the same server for at least a year, and it has been writing files without any problems (assets, updates, etc.)
KSP
CC BY-SA 4.0
2018-07-23T01:01:19.167Z
`phpinfo()` should tell you that
andrew.welch
CC BY-SA 4.0
2018-07-23T08:00:37.233Z
Hm, does phpinfo() tell you the user it runs as on the server? I can't find it anywhere there at least.
KSP
CC BY-SA 4.0
2018-07-23T08:30:49.120Z
It's not in phpinfo(), but I managed to find the user via posix_geteuid() and posix_getpwuid(). But it actually reports that it's running under the same user as the owner of the files (basically my account).
KSP
<craft3><permissions><configuration>
Craft 3 admin panel only accessible when web/cpresources is exectuable for everyone
# Craft 3 admin panel only accessible when web/cpresources is exectuable for everyone

(Asked by: username_0 on 2018-07-22)

I’m trying to move a local Craft 3 site to a local server (hosted on 1&1).
The website itself runs fine, but for some reason I can only access the admin panel when the web/cpresources folder has permissions set to 777, which I obviously don’t want. (EDIT: It also seems to work with 755, but the folder probably shouldn't be executable by everone, right?)
All other folders where Craft needs write access are set to 744, as per the install instructions, and as long as web/cpresoures are 755, everything else seems to work fine.
Does anyone have an idea what can be the issue and a possible solution here?
Unfortunately I don’t know which user PHP runs under, but as a standard web hosting setup, I would guess it should be able to write to the file system without open access for everyone, and again everything else seems to be working like normal.
UPDATE:
It only
I managed to get the user by running this code:
$username = posix_getpwuid(posix_geteuid())['name'];
$echo $username;

The reported user is the same as my account, meaning php should run as the same user that owns the files.

**Tags:** craft3, permissions, configuration

> **Comments:**
> **username_1**: You need to determine the user/group php runs as, because that's what needs write perms for the web/cpresources folder. More here: https://nystudio107.com/blog/hardening-craft-cms-permissions  
> **username_0**: Yes, I realise that. Unfortunately I can't really determine what the php user runs as, or what group it's in, as I'm on a shared hosting with no access to the php installation itself. But I've had a running version of Craft 2 on the same server for at least a year, and it has been writing files without any problems (assets, updates, etc.)  
> **username_1**: `phpinfo()` should tell you that  
> **username_0**: Hm, does phpinfo() tell you the user it runs as on the server? I can't find it anywhere there at least.  
> **username_0**: It's not in phpinfo(), but I managed to find the user via posix_geteuid() and posix_getpwuid(). But it actually reports that it's running under the same user as the owner of the files (basically my account).  

---

## 0 answers

