phundament / app

Dockerized Yii2 web application base
http://phundament.com
Other
310 stars 129 forks source link

Setup Error #158

Closed abolivar closed 9 years ago

abolivar commented 9 years ago

Any idea please? I know that is wrong in my settings, because yesterday install on a different pc. I already check permissions and nothing. My OS is Ubuntu

$ ./yii app/setup

PHP Warning: file_get_contents(/var/www/html/myapp/config/../version): failed to open stream: No such file or directory in /var/www/html/myapp/config/env.php on line 13 .......

http://localhost/myapp/web/

PHP Warning – yii\base\ErrorException

touch(): Utime failed: Operation not permitted

  1. in /var/www/html/myapp/assets/AppAsset.php at line 50 // Touch the asset folder with the highest mtime of all contained files // This will create a new folder in web/assets for every change and request // made to the app assets. if (YII_ENV_DEV) { $files = FileHelper::findFiles(\Yii::getAlias($this->sourcePath)); $mtimes = []; foreach ($files AS $file) { $mtimes[] = filemtime($file); } touch(\Yii::getAlias($this->sourcePath), max($mtimes)); } } }
schmunk42 commented 9 years ago

Thanks for filing the bug.

I added an feature to have the app version in a file, obviously it doesn't work for you. How did you install Phundament, composer, git, zip, docker?

Could you try running

./yii app/version

Does this fix the error?

As a last resort, you can create a file called version in the project root with

0.0.1

Hope this helps, but'll fix that with the next release.

abolivar commented 9 years ago

I install with composer

$ ./yii app/version PHP Warning: file_get_contents(/var/www/html/myapp/config/../version): failed to open stream: No such file or directory in /var/www/html/myapp/config/env.php on line 13 Application Version fatal: Not a git repository (or any parent up to mount point /var/www/html) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).fatal: Not a git repository (or any parent up to mount point /var/www/html) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

I create the version file and I do not have the warning in app/setup but I keep having the other error with touch(): Utime failed: Operation not permitted Any idea? and other error soved with $ sudo chown -R www-data /var/www/html/myapp/

dungphanxuan commented 9 years ago

Hello, i have same error on setup app, i install app with zip file from github!

Warning: file_get_contents(C:\xampp\htdocs\playground\config/../version): failed to open stream: No such file or directory in C:\xampp\htdocs\playground\config\env.php on line 13

Solve. I copy version file from phundament/playground and it run!

deaboway commented 9 years ago

got the same error.

No version file found: $ ./yii app/version

Warning: file_get_contents(/Applications/XAMPP/xamppfiles/htdocs/phun/config/../version): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/phun/config/env.php on line 13 Application Version

Error: touch(): Utime failed: Operation not permitted in /Applications/XAMPP/xamppfiles/htdocs/phun/assets/AppAsset.php at line 50

schmunk42 commented 9 years ago

As a workaround, you could replace this line with the following:

if (getenv('APP_ASSET_FORCE_PUBLISH')) {

This will use another ENV variable than YII_ENV for forced asset publishing. We also stumbled upon that and will fix that with the next release.

PS: Depending on your setup you may not need to force publish assets at all, see here for more details about this topic.

schmunk42 commented 9 years ago

We added the ENV variable a while ago, see https://github.com/phundament/app/blob/f4c898537b183df5caf2d04c2cb91fc5c54f00ae/.env-dist#L31

Please reopen, if there are still issues.