Why can't PHP flock on btrfs filesystem? - php

I am trying to set up a chromebook for Laravel development and I was having trouble with my project throwing "419 Page Expired" on every form. The project works fine on a Manjaro development machine.
I traced the issue down to Laravel's file-system session driver not retrieving the session token from the file system.
It seems that Crostini (ChromeBook Linux Container) uses a btrfs root filesystem and any attempt to use php's "flock" function always results in a failure response.
Has anyone come across this before? Does anyone have any idea of a possible work-around? I would imagine, with the abundance of containerised development environments, that this is a common problem, but I have googled to no avail.

Related

Cannot load custom routes in Phalcon PHP

Until yesterday my Phalcon PHP application was running perfectly on PROD and today is working only on DEV and LOCAL environments... and I don't have a clue what is going on there! The codebase is exactly the same on all environments, the configs and the routes are correct as well.
For example, if I want to get to a custom defined route, like "/my-custom-route", it always gives me the error message "MyCustomRouteController handler class cannot be loaded". But the rest routes are working fine, like "/contacts" which comes from ContactsController.
As an additional information, "/my-custom-route" has been implemented through ToolsController and gearAction().
The problem appears only on PROD! On DEV and LOCAL there are no such issues which is super strange... The LIVE server is Debian with Apache. DEV server is the same (Debian/Apache), and LOCAL has Ubuntu/Apache installed. All versions are the latest ones - Phalcon Framework (3.4.5), Apache (2.4.41), PHP7 (7.0.33), MariaDB (10.1.43).
Does anyone have an idea where might be the issue?
My first guess would be a case sensitive issue. But since you're running Debian on dev as well don't think this is the issue.
Not sure what changes are done but maybe you're looking at a file being cached by opcache?
Problem solved! Turns out that it was a configuration issue. I use values from an INI file where env, site_url, api_url are defined and the site_url was set without 'www.' which caused the custom URLs to be unavailable.

Symfony ClassNotFoundException - JwtAuthenticator

Im working on a existing project, which uses symfony to provide web services. I'm new to Symfony technology but I have good experience in Laravel, the project has an issue in JwtAuthenticator.
Symfony\Component\Debug\Exception\ClassNotFoundException
Attempted to load class "JwtAuthenticator" from namespace
Thing is this issue does not occur in windows OS, but while working in linux Ubuntu it occurs, so far what I found is that the cache data seems to trouble, also unable to delete them without changing the folder access permission to 777. But once if it is given full access permission and if the cache folder is emptied then application runs without error, but from the next request it again happens. So if removing files in cache is done then it works.
Here, JwtAuthenticator is used to provide authentication verification
Can anyone help me to solve this.

laravel slow to render pages issue

I'm booting up a development server for my laravel project with:
php artisan serve --port=3030
The issue is that the response time is way too long (~17 seconds). Chrome dev tools are saying the routing to the index method is the issue but, I'm only attempting to retrieve a basic view.
Does anyone have any advice? This is an issue on all my laravel projects on my work machine.
Appreciate any response,
Sam

bootstrap.php.cache is missing

I have a problem with Symfony 2. trying the example from the book. I have written a controller but when i go to the URL specified in the route i get an error. The server can't find the page. When i run app_dev.php i get an error that the file boostrap.php.cache is missing.
searched on the internet but found nothing relevant so far. I don't know if the front-controller is already written or if that is something that still has to be done by me.
I can't get the application to run.
Found the solution. I followed the guidelines installing sf2 in netbeans. Instead of running the application as a local website i used the build-in server option wich gave me access to the cli commands. There i could use the command run server and all of my problems were gone.

WindowsAzure: Develop on deployed PHP Files

I work a lot with the WindowsAzure4E(clipse) IDE. And it's always pain to wait for the local test deployment)
Isn't there a way to develop on the deployed PHP files which must be stored somewhere to inetput or something else?
thx for your ideas.
Yes! In fact, I just got this working myself yesterday.
After installing PHP 5.3 with CGI support for IIS (making the necessary php.ini modifications of course), I simply created a new site in IIS that mapped to a role in the workspace for my Eclipse project.
Keep in mind that there's one hiccup to this and that is that the php_azure.dll file, used to access the service configuration and mount azure drives, was built to run in the azure fabric (either development or hosted). In my case, I don't NEED these features so I removed referrences to things like getconfig and poof the project loads in IIS just fine. I only need to make sure I start Azure Storage prior to launching the application.
I've been told that some folks are able to update their systems path environment variable with the location of the azure diagnostics dll (diagnostics.dll) and have it work without this modification. But this route didn't work for me. :(
I'll actually be blogging on this more this weekend as it took me a week of evenings to get things sorted out.
I found out that after the deployment the project files are copied to the folder ServiceDefinition.csx.
When you now edit the source code in this place, you can see the changes directly, without another deployment.

Categories