I ran the homestead make command successfully.
Afterward, I ran the vagrant up command in the vendor/bin folder, but I get the following error:
Vagrant failed to initialize at a very early stage:
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.
Path: C:/xampp/htdocs/all-projects/project1/vendor/bin/Vagrantfile
Line number: 0
Message: LoadError: cannot load such file -- C:/xampp/htdocs/all-projects/project1/vendor/bin/vendor/laravel/homestead/scripts/homestead.rb
The path to homstead.rb is incorrect. Such a path does not exist and the homestead.rb file is in another folder for the project. How do I fix the homestead.rb path that is automatically used by vagrant?
P.S. the /laravel folder is present in the project directory.
You need to edit your Vagrantfile. In there is a line that references homestead.rb. Mine looks like
require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')
Update this to be the correct path.
I've been trying to deploy my Laravel 6 App to the standard environment of Google App Engine the whole day, but seems like I'm just stuck at how to make cache and some "local" files to work.
This is the error I get when I try to load any page:
(1/1) InvalidArgumentException
Please provide a valid cache path.
in Compiler.php line 36
at Compiler->__construct(object(Filesystem), false)
in ViewServiceProvider.php line 92
at ViewServiceProvider->Illuminate\View\{closure}(object(Application), array())
in Container.php line 799
at Container->build(object(Closure))
in Container.php line 681
at Container->resolve('blade.compiler', array(), true)
in Application.php line 785
(...)
I followed every tip at this question, this tutorial and this issue, but anything seemed to help me.
As CACHE_DRIVER, for convenience, I'm trying to just use file, instead of database or any other else. So, my app.yaml, have the additional env_variables :
CACHE_DRIVER: file
SESSION_DRIVER: cookie
APP_STORAGE: /tmp
VIEW_COMPILED_PATH: /tmp
APP_SERVICES_CACHE: /tmp/services.php
APP_PACKAGES_CACHE: /tmp/packages.php
APP_CONFIG_CACHE: /tmp/config.php
APP_ROUTES_CACHE: /tmp/routes.php
I know that the /tmp folder is the only writable folder for the App Engine Standard Environment. With that in mind, I put the above at app.yaml, and even tried renaming /storage folder to /tmp.
I've added the following line to my bootstrap/app.php file:
$app->useStoragePath(env('APP_STORAGE', base_path() . '/tmp'));
At my composer packages, I made sure that it doesn't have facade/ignition. Also, as I can't run any command after deploy my app to Google App Engine, at composer.json I have:
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump"
],
"post-install-cmd": [
"composer dump-autoload",
"php artisan config:clear",
"php artisan view:clear",
"php artisan cache:clear"
]
I also tried to put at post-install-cmd php artisan storage:link, while using $app->useStoragePath(env('APP_STORAGE', base_path() . '/storage')); and the /storage folder as storage itself, but nothing worked.
I have the whole folder tree for caching at my /temp (or /storage, if this is the right way) folder:
/tmp
/framework
/cache
/data
/sessions
/testing
/views
/logs
/medialibrary
/temp
Also, besides the views not rendering, I noticed that when trying to load the favicon.ico, located at /public folder, it returns an 500 error. I am new to AppEngine, but even reading everything I can find I've been struggling to make it work. I really appreciate any help.
I figured out I had some config files published at /config, and besides changing /bootstrap/app.php, some of them had their own path to /storage folder. So, my solution was just gave up on using files cache, and for the views cache, and some other packages I had, use the path /tmp, at their respective config files. Also, I removed all cache cleaning artisan commands from composer, as I wasn't sending any cache files to deploy.
Also, I needed to make some changes in order to be able to access /public files, like some local css and js. For this, I followed these docs.
I was struggling with the same problem today and the solution was I changed the 'compiled' value in config/view.php to a root folder:
Go to root directory.
mkdir compiled_views
Change 'compiled' value to 'compiled' => realpath(base_path('compiled_views/')),
I solved it by explicitly adding the APP_STORAGE env in config/view.php:
'compiled' => realpath(env('APP_STORAGE', realpath(storage_path('framework/views')))),
(which surprises because I do have $app->useStoragePath(env('APP_STORAGE', base_path() . '/storage')); added to app.php - but it seems that it didn't yet(?) override storage_path )
My Symfony2 project is throwing a exception:
Warning: file_get_contents(/Users/arne.banck/repos/Branditto_platform/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig): failed to open stream: No such file or directory
The problem is that the file is there in my folder structure, I did pwd through terminal:
/Users/arne.banck/repos/Branditto_platform/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception
The following files are in this map:
error.atom.twig exception.atom.twig exception_full.html.twig
error.css.twig exception.css.twig logs.html.twig
error.html.twig exception.html.twig trace.html.twig
error.js.twig exception.js.twig trace.txt.twig
error.json.twig exception.json.twig traces.html.twig
error.rdf.twig exception.rdf.twig traces.txt.twig
error.txt.twig exception.txt.twig traces.xml.twig
error.xml.twig exception.xml.twig traces_text.html.twig
Already halted vagrant and upped again, also cleared cache already.
Any ideas?
I have created custom helper laravel 5.2. I put in folder App/Helpers/Global.php.
and autoload files in composer.json :
"autoload": {
"files" : [
"App/Helpers/Global.php"
]
}
On my Windows PC, it's working fine, but when i deploy to VPS centos I got this error.
PHP Warning: require(/xxxx/xxxxx/public_html/xxxx/vendor/composer/../../App/Helpers/Global.php): failed to open stream: No such file or directory in /xxxx/xxxx/public_html/xxxx/vendor/composer/autoload_real.php on line 66
why Autoloading "files" is relative to vendor directory ?
Thanks in advance.
error custom helper
It seems that OS on your VPS has case sensitive filename file system unlike Windows.
Just replace "App/Helpers/Global.php" with "app/Helpers/Global.php" and it should help.
I have cloned the project from Github and tried to run the migration to make the database but it does not work. Why?
I get the following error:
bash: ./yii: No such file or directory
Path to yii file is incorrect. make sure current directory of command line is set to project root where 'yii' file is stored.