I'm following the tutorial on Lighthouse website for the master version (4.1).
https://lighthouse-php.com/4.1/getting-started/tutorial.html#installation
I make a fresh intallation of Laravel 5.8, then I execute the commands written in the tutorial (beside npm install)
composer require nuwave/lighthouse mll-lab/laravel-graphql-playground
php artisan vendor:publish --provider="Nuwave\Lighthouse\LighthouseServiceProvider"
php artisan vendor:publish --provider="MLL\GraphQLPlayground\GraphQLPlaygroundServiceProvider"
after that a /graphql/schema.graphql file is created (under the project root, not under the routes folder as happened with the previous versions).
Now I populate the DB with some data and then I copy/paste the schema from the tutorial page to the published schema, I start the server, then I access playground which shows the correct url where to send the requests http://127.0.0.1:8000/graphql.
Clicking on the Schema tab I always see the default schema and not the one published in /graphql/schema.graphql, and of course the queries for the resources different from the users fails with an error like Cannot query field "posts" on type "Query".. I've already tried restarting the server and refreshing the Playground page.
Into the config/lighthouse.php file the schema is registered to the path base_path('graphql/schema.graphql') which looks correct.
Why Playground always shows the default schema and not the published and edited one?
I'm using PHP 7.2.14 and Lighthouse requires PHP>7.1
I thought the problem is related to the caching. I tried to add LIGHTHOUSE_CACHE_ENABLE=false to the laravel .env file and restart the server then refresh the playground page. I recheck the schema and it is updated.
I hope it's useful.
Related
I am working on a Symfony project (eshop website). I developed my website with symfony 5.4 and I have been using the command symfony serve to get a live server during the development.
My website is actually working well, but now I need to personalise the url and not using localhost or 127.0.0.1 url by default anymore.
I added the new url I chose in the ".hosts" file in the directory "C:>Windows>System32>drivers>etc" and the server info in the "httpd-vhosts" file in the directory "wamp64>bin>apache>apache2.4.46>conf>extra". Then I used the command "composer require symfony/apache-pack". My website is now working on the new url and I still GET all the data from my Database.
The issue is that I can't Post data in my database anymore using this new url. For example, I can't add a new User, add a product to cart or log a user.
But everytime I run the website with the "symfony serve" command and use the url 127.0.0.1, everything is working well (Add or log user, add product to cart etc.).
Did I miss a dependencies to run it well on the new url ?
my local GraphQL backend throws Internal server errors, when I try to fetch stuff from the DB. The live environment which is identical runs without those errors. In the chrome DevTools under Network GraphQL outputs following debug message when I try to fetch the data from the frontend (ionic):
debugMessage: "Warning: rename(D:\pathToLocalBackendFolder\var\cache\dev/doctrine/orm/Proxies__CG__AppEntityProperty.php.6058d378460452.39776425,D:\pathToLocalBackendFolder\var\cache\dev/doctrine/orm/Proxies__CG__AppEntityProperty.php): Zugriff verweigert (code: 5)"
"Zugriff verweigert" translates to "Access denied"
The backend is Symfony 5.1. And I run a local apache server with Wampserver64 under Windows10 Pro.
The apache hosts my backend with SSL (wasn't easy to setup) but the problem persists also when I create a virtualhost without SSL.
It does seem to fetch all the data anyways but I would like to fix those error messages anyways, because later on it could stab me in the back.
What I tried so far to resolve it:
Write umask(0000); in the beginning of bin/console and public/index.php
Run the wampapache64 and wampmysqld64 services as a local admin user (tested the renaming functionality of the specific files by logging in as that user. So the user I let the services run from has all the necessary permissions. Also I double checked by echoing 'whoami' from within GraphQL. It was the correct user I specified before.)
Gave the var/cache folder and all subfolder and all subfiles full permission (via chmod command and also via Windows folder properties)
Cleared the cache (var/cache) of symfony a couple of times. Sometimes with php bin/console cache:clear or even by deleting tha content manually
I did try everything I could from that link: https://symfony.com/doc/current/setup/file_permissions.html
And I also checked out this link and try to apply it: https://symfony.com/doc/current/setup/web_server_configuration.html
What can I try next?
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
this is a Laravel project, so if it's your first time with php, it becomes a little more complicated.
In a few words:
laravel uses the routes at /routes/web.php, so: it's using: Route::get('/', 'HomeController#getIndex')->name('index'); for the home
/app/Http/Controllers/HomeController#getIndex calls layouts.index view .
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"
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
I've recently moved an OctoberCMS project that I've had stored locally over to a server. Due to the server running PHP 5, I had to downgrade the project to an OctoberCMS version of 419. After getting it running on the server, I try to access any installed plugins through the builder plugin and when I click on one of them in the builder plugin, it outputs the following error:
"syntax error, unexpected ':', expecting ';' or '{'"
This error occurs on line 154 in "vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php".
I mean I'm fairly certain that I installed PHP 5 via composer for the CMS, but it looks like the file is based on PHP 7. Any ideas as to why this could be happening? And if it is because of a PHP version issue, then how would I go about fixing that? Apologies if I seem vague. I've been trying to figure it out for a few days now.
hmm I see as october/rain is of version 1.0.419 and it uses "doctrine/dbal": "~2.4", but unfortunately its not updated to old version. during that php version update.
can you try one thing from your installation just remove vendors folder and modules folder
make sure if you change any core code in modules first take a backup of that file then delete that folder.
Backup your database.
also config files if needed.
remove vendors folder and modules folder
after that remove your composer lock file
replace your package.json file with this content https://github.com/octobercms/library/blob/v1.0.419/composer.json which is of built .419
now from that directory run composer intsall
it will install all new files based on correct dependency.
[Current issue is may be due to some dependencies are not updated to old version]
now just restore all you config file [not sure not needed may be as all stuff will be untouched by these process so just check if needed]
now do database migration with this command - php artisan october:up
this should start your site.
if you find any problem please comment.
I have been trying to apply Unisharp Laravel Filemanager. But, the issue I am facing is that when ever I try to insert image in CKeditor and click on the Browse Server button, a new window pops up with an HTTP 404 error response code saying:
The requested URL was not found on this server.
I have followed all the steps as mentioned in the docs of Unisharp Laravel Filemanager for installation and integration. Also I am using Laravel 5.4 and Unisharp FileManager 1.6 (released August 2016).
What is causing this 404 error and how can I correct it?
In the lfm.php file the very first setting is a routes setting. That needs to be changed from false to true.
First make sure the following lines were added before App\Providers\AppServiceProvider::class, on the config/app.php
Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
then.
Make sure lfm.php is present in config folder.
Make sure the routes were loaded by running php artisan route:list
if you followed the installation guide and those are not present use php artisan config:cache then run the two vendor publish command on the guide
Hope this helps