Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppStarter Vanilla Installation - No hint that writable directory is not writable #1934

Closed
Tilogorn opened this issue Apr 10, 2019 · 6 comments

Comments

@Tilogorn
Copy link

Just installed CI4 via AppStarter, changed nothing more than the baseURL and got a 500 in the browser saying "Whoops! We seem to have hit a snag. Please try again later...".

Digging deeper I found out that there happens a call to a cache()->get()-function which checks if the current request is already cached. Combined with the finding, that the default cache handler is "file", I guessed and made the writable directory writable for www-data and the request succeeded.

Neither the installation section in the CI4-docs nor the CI4-error message gave me a hint to the correct direction. Maybe one of those two could be optimized (preferring a more meaningful 500 error message). It was just experienced PHP-dev intuition and debugging in the vendors directory, which not everyone may be capable of, that lead me to the right fix.

@Tilogorn
Copy link
Author

Just noticed that this is perfectly documented when one changes the environment to "development". I'll close the issue although I am not super happy with this behaviour. Might or might not discourage newbies to PHP/CodeIgniter; even an experienced dev like me did not think automatically that the default environment may prevent helpful error messages from displaying.

Maybe a little hint on the installation page may not be the worst idea, but thats up to the devs.

@jim-parry
Copy link
Contributor

Which OS are you using? When I install the appstarter on Linux, it results in app, public & vendor all writable

@Tilogorn
Copy link
Author

Writable yes, but for the wrong user.

$ cat /etc/*-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=19
DISTRIB_CODENAME=tara
DISTRIB_DESCRIPTION="Linux Mint 19 Tara"
NAME="Linux Mint"
VERSION="19 (Tara)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 19"
VERSION_ID="19"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.ubuntu.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=tara
UBUNTU_CODENAME=bionic
$ php composer.phar create-project codeigniter4/appstarter -s beta --no-dev
Installing codeigniter4/appstarter (v4.0.0-beta.2)
  - Installing codeigniter4/appstarter (v4.0.0-beta.2): Loading from cache
Created project in /var/www/html/appstarter
Loading composer repositories with package information
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Package operations: 4 installs, 0 updates, 0 removals
  - Installing zendframework/zend-escaper (2.6.0): Loading from cache
  - Installing psr/log (1.1.0): Loading from cache
  - Installing kint-php/kint (2.2): Loading from cache
  - Installing codeigniter4/framework (v4.0.0-alpha.4): Loading from cache
Generating autoload files
$ ls -la appstarter/
insgesamt 128
drwxrwxr-x  7 tilogorn   tilogorn    4096 Apr 10 18:06 .
drwxrwxr-x 44 www-data www-data  4096 Apr 10 18:05 ..
drwxrwxr-x 12 tilogorn   tilogorn    4096 Apr  4 09:12 app
-rw-rw-r--  1 tilogorn   tilogorn     664 Apr  4 09:12 composer.json
-rw-rw-r--  1 tilogorn   tilogorn   60615 Apr  4 09:12 composer.lock
-rw-rw-r--  1 tilogorn   tilogorn    5288 Apr  4 09:12 contributing.md
-rw-rw-r--  1 tilogorn   tilogorn    3228 Apr  4 09:12 env
-rw-rw-r--  1 tilogorn   tilogorn     367 Apr  4 09:12 .gitignore
-rw-rw-r--  1 tilogorn   tilogorn    1084 Apr  4 09:12 LICENSE
-rw-rw-r--  1 tilogorn   tilogorn    1112 Apr  4 09:12 license.txt
-rw-rw-r--  1 tilogorn   tilogorn     840 Apr  4 09:12 phpunit.xml.dist
drwxrwxr-x  2 tilogorn   tilogorn    4096 Apr  4 09:12 public
-rw-rw-r--  1 tilogorn   tilogorn    2445 Apr  4 09:12 README.md
-rwxr-xr-x  1 tilogorn   tilogorn    1775 Apr  4 09:12 spark
drwxrwxr-x 19 tilogorn   tilogorn    4096 Apr  4 09:12 _support
drwxrwxr-x  7 tilogorn   tilogorn    4096 Apr 10 18:06 vendor
drwxrwxr-x  7 tilogorn   tilogorn    4096 Apr  4 09:12 writable

@jim-parry
Copy link
Contributor

I see it user (you) and group writable. Who should it be writable for?

@Tilogorn
Copy link
Author

The apache user! On Ubuntu&Co www-data. The one that writes to cache files etc. when you access the framework with a browser.
At least thats my understanding of writable and it solved my issue.

@jim-parry
Copy link
Contributor

Hmmm - I think that will have to go in the writeup rather than the script, then, as that could vary between platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants