skip to Main Content

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.

  1. composer install
  2. edit .env
  3. php artisan migrate:refresh --seed -vvv

testing vendor/bin/phpunit

This was the guide.

What i did step by step.

  1. installed wamp64
  2. cloned the repo into www
  3. installed composer
  4. ran the composer install command on the right folder
  5. created virtual host for the folder with wamps add a virtual host option, named targygraf.test
  6. created a db with phpmyadmin and set pw
  7. edited the .env file to targygraf.test and to use the db and pw i created
  8. 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


  1. Chosen as BEST ANSWER

    What I did to resolve this problem

    • reinstalled wamp and composer
    • forked a clean repo of the project
    • ran composer install
    • set phpmyadmin pw
    • created mysql table
    • created virtual host, this time pointing to [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)
    • ran php artisan migrate:refresh --seed -vvv

  2. this is a Laravel project, so if it’s your first time with php, it becomes a little more complicated.
    In a few words:

    1. laravel uses the routes at /routes/web.php, so: it’s using: Route::get('/', 'HomeController@getIndex')->name('index'); for the home
    2. /app/Http/Controllers/HomeController@getIndex calls layouts.index view .
    3. this view uses /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”

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search