back-end is ok,but front-end ,the image is broken
-
My Steps:
cd /workdir
composer create-project bagisto/bagisto mywebtmp
mv all the files in the mywebtmp to /workdir/myweb
cd /workdir/myweb
I only changed the database's info in the .env
php artisan install
I use a local domain to the /workdir/myweb/public, the domain is http://test.bagisto
Finished!
Then, http://test.bagisto can open, http://test.bagisto/admin also can open. but only no image front-end and back-end.so I do next:
cd /workdir/myweb
rm public/storage
php artisan storage:link
Then vim .env APP_URL=http://test.bagisto
Then
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache
composer dump-autoload
php artisan vendor:publish
It is all successed.The when I upload image jpg back-end, and when I edit the produce to see the image, it is there.
http://test.bagisto/storage/product/30/glRwTsK5ITBnJyRa7hyjGL6D2K606Ds4qA1hqnZc.jpg
and
ls /workdir/myweb/public/storage/product/productid/
also can see the jpg , so the back-end is ok.but I cannot find the /workdir/myweb/public/cache , no this dir.
http://test.bagisto/cache/small/product/30/glRwTsK5ITBnJyRa7hyjGL6D2K606Ds4qA1hqnZc.jpg
also it is broken.
how to fix this? thanks. -
This is because we are using the intervention package, and the image will not get if you have not installed GD extension,
https://devdocs.bagisto.com/1.x/introduction/requirements.html#php-extensions -
@15913132323 said in back-end is ok,but front-end ,the image is broken:
My Steps:
cd /workdir
composer create-project bagisto/bagisto mywebtmp
mv all the files in the mywebtmp to /workdir/myweb
cd /workdir/myweb
I only changed the database's info in the .env
php artisan install
I use a local domain to the /workdir/myweb/public, the domain is http://test.bagisto
Finished!
Then, http://test.bagisto can open, http://test.bagisto/admin also can open. but only no image front-end and back-end.so I do next:
cd /workdir/myweb
rm public/storage
php artisan storage:link
Then vim .env APP_URL=http://test.bagisto
Then
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache
composer dump-autoload
php artisan vendor:publish
It is all successed.The when I upload image jpg back-end, and when I edit the produce to see the image, it is there.
http://test.bagisto/storage/product/30/glRwTsK5ITBnJyRa7hyjGL6D2K606Ds4qA1hqnZc.jpg
and
ls /workdir/myweb/public/storage/product/productid/
also can see the jpg , so the back-end is ok.but I cannot find the /workdir/myweb/public/cache , no this dir.
http://test.bagisto/cache/small/product/30/glRwTsK5ITBnJyRa7hyjGL6D2K606Ds4qA1hqnZc.jpg rice purity test
also it is broken.
how to fix this? thanks.
The issue seems to be with image caching in your Bagisto project. Ensure the storage:link command was executed correctly, file permissions are set properly, and the image processing package is configured correctly. Try clearing the cache and running php artisan bagisto:image:generate to force the cached images to be generated. -
Hello @kenaanna
Make sure the following extensions are installed and enabled. You can check using the phpinfo() page or the php -m command.
php-intl extension
php-gd extension
NOTE- You must install the php-gd extension properly otherwise, the image does not work properly in the project.
Thanks & Regards..!!