alphazframework / framework

Core files of AlphaZ Framework
https://alphazframework.github.io/
MIT License
16 stars 17 forks source link

Permission denied after installing Zest framework #236

Closed lablnet closed 5 years ago

lablnet commented 5 years ago

Premission dined because whenever user first run zest framework it created default directories

here is order

 ../Storage
/Storage/Data
/Storage/Logs
/Storage/Session
/Storage/Cache
/Storage/Backup

In the file

https://github.com/zestframework/Zest_Framework/blob/master/src/Files/Files.php#L78

Consider the following method/function:

    public function systemDirs()
    {
        $this->mkDir('../Storage');
        $this->mkDir('../Storage/Data');
        $this->mkDir('../Storage/Logs');
        $this->mkDir('../Storage/Session');
        $this->mkDir('../Storage/Backup');
        $this->mkDIr('../Storage/Cache');
    }

I change it to following:

    public function systemDirs()
    {
        $this->permission(route()->root, 0775);
        $this->mkDir(route()->root.'Storage', null, 0775);
        $this->mkDir(route()->root.'Storage/Data', null, 0775);
        $this->mkDir(route()->root.'Storage/Logs', null, 0775);
        $this->mkDir(route()->root.'Storage/Session', null, 0775);
        $this->mkDir(route()->root.'Storage/Backup', null, 0775);
        $this->mkDIr(route()->root.'Storage/Cache', null, 0775);
    }

But its not working at all

### This issue only occurs when we use Linux based operating system or Macintosh

Here is snapshort

Screenshot from 2019-07-28 00-34-06

peter279k commented 5 years ago

The permission denied message is presented when using the mkdir function.

That's current reason is about the user permission on Unix-like operating system.

It seems that the www-data user cannot access root privilege user directory.

To solve this problem, I think we have to consider this approach.

The steps are as follows:

When developers get this message, they need to solve the permission by themselves.

If we use the Docker container support, we can solve this issue and add commands in Dockerfile.

And developers don't need to solve them manually :).

lablnet commented 5 years ago

oh so it mean it can not be solved by php directly right?

Am not familar with unix like system remission problem

peter279k commented 5 years ago

Hi @Lablnet, thanks for your reply.

It's possible to solve this problem, but it cannot solve this issue with PHP directly.

My suggestion that is mentioned on my previous comment thread and we can consider providing the Docker container to build the framework environment.

And it's easy for developers to build their own Zest framework via Docker container.

lablnet commented 5 years ago

Yeah

https://github.com/zestframework/Zest_Framework/issues/146

lablnet commented 5 years ago

So i think this issue should be close right?

peter279k commented 5 years ago

That's right :).