Dev visible in app_dev.php but not visible in app.php - php

I work on an app in symfony 2 which uses the sonata-admin bundle.
I added 6 vars in my entity, and I can edit their value in my back-office to see the result in the front office.
Everything works fine when I go to my website in app_dev.php (and app_dev.php/admin for the back office)
But when I try to access to the website within the app.php, the changes don't show in my front office and I have a 404 error in the back.
If I explicite the vars's typos in the $formMapper of the sonata admin's configureFormFields function, I can see my form but it doesn't get back the values already stored in the database.
I must precise I tried all clear cache options possible, with --env, --no-debug, and I tried to delete the app/cache/prod folder, create it again with the permissions. Apache logs do not show anything in particular.
Thank you for your help.

try to clear cache with
php bin/console cache:clear --no-warmup --env=prod

Related

Symfony completely ignores all the changes I make to code

I tryed click ctrl + r, ctrl f5. Clearing cashe launching application on other browsers. All I want to do is to start work and learn.
enter image description here
anything I do at app/recources/views/default/index.html.twag is completely ignores, I even tryed deleleting whole content of this file, than restarting pc and it still appear as default view. Any changes made to controller is also ignored. He finally starts to notice me when i completely delete index.html.twag file. When i return it back (completely empty by the way) he shows me his default view AGAIN!!!. Please help, any ides?
So eventualy problem was with cache. All I had to do is to run command at my console: php bin/console cache:clear --env=prod
Source: http://symfony.com/doc/current/console/usage.html
When you make changes to your Twig files or your controllers, you should always clear the cache using:
php bin/console cache:clear --env=prod
for your production environment.
The DEV environment is done automatically, but sometimes you still need to clear it with:
php bin/console cache:clear
To access the DEV environment, just append app_dev.php to your route URL. For example: http://localhost/wtf/app_dev.php
If you open that file under the web folder, you'll see you can also add in the IP addresses of remote hosts that you want to allow access.
Hope that helps you.

app_dev.php not always refreshing . How to contrain Netbeans/Browser to display freshest version of code?

it's so annoying.
I'm working with Netbeans and Chrome (but other browers are not better) and i never know whether an error comes from last edited code or previosly edited.
app_dev.php suppose to take care of that, but its not.
I do not know whose cache is responsible for this: Netbeans, Symfony, Browsers.
How to contrain displaying latest version of my code?
edit
if do following steps its not work well:
physically delete cache (even command cache:clear --env=dev)
change code
refresh site
if do following steps its work well:
change code
physically delete cache (dev)
refresh site
Netbeans is an IDE. It will not cache any files I think. Try following this steps:
Use Ctrl+F5 in Chrome to refresh the page with discarding the browser cache
Execute php app/console cache:clear --env=dev after each source code modification
Check your URL in browser address. It should be something like http://localhost/web/app_dev.php
#Olim pretty much covered it all. Only thing I would add is to try physically removing cache directory and running cache:clear again...
EDIT:
I had numerous problems with access rights of my IDE (phpStorm in my case) which could not alter files stored in Apache's default location (C:\Program Files\Apache...). The main cause was the dreaded Windows's UAC which prevented any program to write in some more sensitive locations.
To solve this you can either disable UAC or you could set the proper ownership:
Right click on you project's directory
Click Properties
Click the Security tab, then Advanced button
Switch to Owner tab and then Edit button
Click Other users and groups and enter your username. Click OK
Make sure you check the Replace owner on ....
Restart all related software (Netbeans, Chrome, Apache service...)
Does it work now?

ExpressionEngine 2.1 re-install admin login failure

I replaced a working ExpressionEngine 2.1 install with a reworked one that replaced all templates and so on. I made a backup of the WORKING database and WORKING DIRECTORY. I failed to remember to clear the cache beforehand.
I've tried to reinstall the original WORKING EE on a new dev server to be able to compare some pages and so on. I have run the ee_wizard and the environment is good. I can almost get the site up, but it has some references to the production domain i can't track down. The biggest problem is the admin cp login. I put in the correct login, but the page only refreshes (clears the name and password fields). If i put in an incorrect login, i get an error.
I've tried
-- delete from exp_sessions;
-- delete from exp_security_hashes;
-- incognito window
-- modifying expressionengine/config/config.php values for cookie prefix, domain
anything else i can try?
I really need to get in to check some things
thanks
Have you tried dumping/searching the DB for references to the old domain and doing a find/replace? Also I would do a grep of the config files, htaccess, etc... for instances of the old domain name and change them.

Magento Core Config Data Cache

I had some configuration data caching issues in my magento frontend that,
I cannot get new shipping rates/get template path hints/ etc..
core_config_data table get updated correctly and All backend data shown correcty.
I tried "Flush Magento Cache" button, cleaning <DocumentRoot>/tmp directory, cleaning var/cache directory
(This issue is noticed 2 weeks before and I moved the site to new VPS a month before)
Any ideas??
Check file/folder permissions, the non-flushable, ever magically unchangable core_config_cache is usually the result of having your var/ folder tree unwritable somewhere so it all gets written to the system tmp folder.
Since the backend button only flushes contents in var/cache/, it will never touch anything in /tmp/* and you end up with this mysterious trait where it will change in the admin but the site will not read the config. I just had it happen last week on an upgrade where the permissions got changed.
Similar problem here with URLs that cannot be updated and screenshots of the system tmp cache
One of several posts on setting permissions for Magento to run

Symfony2 permission issue in OSX local environment

I wanted to try out the local apache environment that comes with OSX Mountain Lion.
I did the basic setup and placed a project in the root directory
/Library/WebServer/Documents/
Jumped over too localhost in my browser and everything was working as expected.
However I then decided to follow this guide in order to use the Sites folder in my home directory, for simplicity sake.
http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/
I then reset apache and added this to my browser
http://127.0.0.1/~bengibson/PracTest/
The browser shows a list of a few of the files and directories in the project folder but not all of them :S.
I tried to navigate to one of the missing folders
http://127.0.0.1/~bengibson/PracTest/web/app_dev.php
But I get a forbidden message :(
Anyone know what this needs?
Just for reference here is the project folder
Heres the detailed view in of the folder in terminal
And here is what shown in the browser
I ran into this problem before on OS X when I downloaded the archive file for the Symfony 2 Standard Edition directly in the browser.
The # symbol at the end of the permissions table indicates that the file has additional attributes.
You can see these additional attributes by typing the following command in Terminal as an example, explained here.
$ xattr -l ~/Sites/PracTest/web/app_dev.php
The result returned is com.apple.quarantine.
This is the way OS X protects potentially malicious files downloaded from the internet from being readily available, which is why in Finder you get the warning box alerting you about opening a file downloaded from the internet.
In your case, to remove these extended attributes, run
$ xattr -rd com.apple.quarantine ~/Sites/PracTest
IF you wanted to know what this command does:
The -d flag removes the extended attribute specified after it, followed by the path.
The -r flag acts recursively, on all subfolders and files.
You should now be able to access both app.php and app_dev.php in the browser.
I'd also like to take the opportunity to recommend creating a new Symfony2 project with Composer rather than downloading it directly. It's hard to look back.
For anyone else who may happen on this blog, I had a similar issue and after a bit of looking around I found that I had forgotten the 'FollowSymLinks' Option in the username.conf file
sounds like permissions.
right click folder, get info, unlock with admin password bottom right and make all users able to read and write. then click the gear looking menu below it and tell it to apply to all contents within as well.

Categories