0

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

4

2 回答 2

0

这是一个 Laravel 项目,所以如果你是第一次使用 php,它会变得有点复杂。简单来说:

  1. laravel 使用 /routes/web.php 中的路由,因此:它正在使用:Route::get('/', 'HomeController@getIndex')->name('index');用于家庭
  2. /app/Http/Controllers/HomeController@getIndex调用layouts.index视图。
  3. 此视图使用/resources/views/template.blade.php. 你可以在那里检查你的css和js。

您可以替换{{ url('assets/css/style.css') }}'/assets/css/style.css'查看浏览器是否以这种方式找到文件。

无论如何,还有其他可能的问题,请记住您的 Apache 服务器应该打开“[project_folder]/public”

于 2018-10-14T16:02:12.147 回答
0

我做了什么来解决这个问题

  • 重新安装了 wamp 和 composer
  • 分叉了一个干净的项目回购
  • 跑了composer install
  • 设置 phpmyadmin 密码
  • 创建了mysql表
  • 创建了虚拟主机,这次指向[project_folder]\public而不是[project_folder](这是重要的部分,因为指向[project folder]页面将加载但没有 css,但指向[project_folder]\public页面的地址完美工作)
  • 跑了php artisan migrate:refresh --seed -vvv
于 2019-03-13T16:35:55.430 回答