I forked a working php project from github to create some json files to it, but i can’t test it because js and css won’t load, i have never used php in my life, so i followed what the install guide said.
composer install
- edit .env
php artisan migrate:refresh --seed -vvv
testing vendor/bin/phpunit
This was the guide.
What i did step by step.
- installed wamp64
- cloned the repo into www
- installed composer
- ran the
composer install
command on the right folder - created virtual host for the folder with wamps add a virtual host option, named targygraf.test
- created a db with phpmyadmin and set pw
- edited the .env file to targygraf.test and to use the db and pw i created
- ran
php artisan migrate:refresh --seed -vvv
It did what it should i suppose because the database built up, and i was able to access the page with the server.php file, except that css and js didn’t load.
Checked with the inspector and they were linked like this http://targygraf.test/server.php/assets/js/targygraf.js
, i have visited a TON of forums about the problem, every single one said that i have to turn rewite_module
on and set AlloweOverride
to All so i did. But still nothing, and as i said earlier, the app was working on another pc and is working online right now, so i’m guessing i did something wrong.
This is the original github link: https://github.com/valentinxxx/targygraf
Edit1: corrected step 5 and 7, added original link
2
Answers
What I did to resolve this problem
composer install
[project_folder]public
instead of[project_folder]
(This is the important part as with pointing to[project folder]
the page will load but without css, but with the address pointing to[project_folder]public
the page works perfectly)php artisan migrate:refresh --seed -vvv
this is a Laravel project, so if it’s your first time with php, it becomes a little more complicated.
In a few words:
Route::get('/', 'HomeController@getIndex')->name('index');
for the home/app/Http/Controllers/HomeController@getIndex
callslayouts.index
view ./resources/views/template.blade.php
. You can check your css and js there.You can replace
{{ url('assets/css/style.css') }}
for'/assets/css/style.css'
and see if this way the browser finds the file.Anyway, there are other possible problems, keep in mind your Apache server should open “[project_folder]/public”