I'm working on a new Symfony2 project, and I'm using the app_dev frontcontroller to view the default AcmeDemoBundle's pages.
When I make changes to the controllers, I get an exception (NotFoundHttpException: No route found for "GET /demo/hello/World"). If I clear the cache using php app/console cache:clear, things work great again. However, it is my understanding that by using the app_dev front controller, I shouldn't be required to do this. Am I doing something wrong?
Soms system specs:
OSX Lion using MAMP
PHP 5.3.6
Symfony 2.0.1
Are you using different users for webserver and command line user? Maybe you should check for permissions in the Setting up Permissions paragraph.
Related
I just migrated from a windows based laptop to a macbook.
I'm pretty new to MacOS
I'm developing a laravel project in my mac and I want to access the url through custom domain using virtual host such as mylaravel.com or something else, i'm not using xampp, only php, and composer.
for example:
currently I access my laravel project through:
sudo php artisan serve --port=80
and this is the url to access my
localhost
what I want is the following url:
mylaravel.id
How can I achieve it?
Thank you.
you can use laravel valet.
look at this documentation.
When using session on my local environment all worked ok, but when I publish the site in a shared hosting I started noticing some strange behaviours in the app. After a while I realized it has to do with the session and specifically I noticed that when I was working on my local environment the storage/framework/sessions folder only had 1 file that keep updating on any change but then on production I start monitoring the same folder and I realized that on any change instead of updating the file (or creating a new one and deleting the other) it was creating a new file but also keeping the old files making the app start acting in a wrong way.
Is this normal or should it be only 1 file per session as it was in the local environment?
Update
After login the user the app ask to select the business they want to work and also they can change between business after, to store the business they choose I use the session and there is where the problem pop, after every change on that property of the session it creates a new session file without deleting the old one. Again when I do exactly the same thing locally it works but for some reason on the shared hosting it doesn't.
SOLUTION
After days of trying to figure it out, I just figure out the solution.
Instead of using the Global Helpers of Laravel for storing the data I did it throw the request and apparently that work it out.
So basically instead of doing this:
session('clienteElegido' => $client);
I change it for this:
$request->session()->put('clienteElegido',$client);
I still don't understand what's the difference and why it was working fine in my local environment and not in the share host but its working now like that so all good.
Thank you for all the quick replies.
Try clearning cache, route, config and view
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
and let's see if your session issue will be fixed.
How about, some time ago I had installed this utility to monitor the query results in my application, now I want to remove it, but I do not know how, someone knows how I can deactivate it?
Welcome to StackOverflow!
That bar at the bottom is called the Laravel Debugbar which is found here: https://github.com/barryvdh/laravel-debugbar
It is controlled by a setting in your .env file in the root of your project called APP_DEBUG. Set this to false to hide the bar (recommended for production).
To uninstall it from your project completely, run composer remove barryvdh/laravel-debugbar. Depending on your Laravel version, you may also have to remove the Service Provider from config/app.php (under providers) or remove it from app/Providers/AppServiceProvider.php depending how you originally installed it.
Note: If you're caching your config (by using php artisan config:cache) then don't forget to clear your config cache after changes by running php artisan config:clear.
I want to access symfony session data from another php page, based in web directory.
I've defined:
$this->getRequest()->getSession()->set('school', 'abc');
And want to get('school') in another php paged existed in web directory (not a controller). I've searched Google for hours and tried lots of alternatives but couldn't be success.
I've solved this problem with this solution:
In config.yml:
framework:
session:
save_path: ~
Then I started a session_start(); in a plain php script.
And accessed via:
$_SESSION['_sf2_attributes']['my_value'];
Now, it's ok.
I am unfortunately getting a blank page when trying to run a site locally. There are other people running it locally just fine, so I am wondering if it could be something to do with my LAMP environment.
When I attempt to load the site, it's nothing but a blank page. I've ran php index.php in console and the error I get is the following "xajax Error: xajax failed to automatically identify your Request URI.Please set the Request URI explicitly when you instantiate the xajax object.". I'm not quite sure how to handle this in CodeIgniter and or at all to be honest.
I think it's a problem with LAMP configuration: check codeigniter folder permissions (add write permission to "logs" folder.
Thanks for your answer. I actually figured out what the problem was, it was like you said a problem with my LAMP configuration. Unfortunately XAMPP (which is what I am using and or was), the newest version uses PHP 5.3. Xajax doesn't support PHP 5.3 and this was causing the problems. After I went to an older version all was well!