The project is Prestashop in PHP server. I have accidently change the controllers/front/ProductController.php's name into ProductController.phps. I immediately change it back to ProductController.php. But the system return response code 500 with error after I reload the page:
ClassNotFoundException
Attempted to load class "Product" from the global namespace.
Did you forget a "use" statement for "PrestaShop\Module\FacetedSearch\Hook\Product"?
How can I fix this?
(update)
Before I accidently done the wrong change, I remember I also remove the classes/Product.php. When I reload the page and found it does not change anything (not even error 500), I add it back to the system. I guess that could be restore the system automatically.
You can try to delete the cache files manually from:
var/cache/prod
var/cache/dev
Or, at least class_index.php, which is available there.
Related
I'm quite new to PHP and have received some Symfony2 project to maintain. Now I've found out that when I update foo.html.twig, that page will not change until I perform the command console c:c -e prod. Until then the shown page will be foo.html_.twig (hence the underscore).
The problem is that I've changed a controller, let's say BarController.php, but the new added value in that controller does not work in the .twig file, I think because the BarController_.php did not get updated with the clear cache command. What did I do wrong here?
Edit:
As Nate says it's not Symfony that caches controllers, but at least I see that BarController_.php is much older than BarController.php, and it's the one with the underscore that does not have the newly added value.
Edit 2:
BarController.php and BarController_.php both reside in the same folder.
Sometimes you need to clear cache by your own. You can try
rm -rf app/cache/prod/*
and don't forget to change rights.
Apparently I was completely looking at the wrong places. It had nothing to do with caching at all.
Those underscored files appeared because of my hacky way of 'version control', which meant I copied a file I was going to edit, put '.old' after the filename so I had a backup. For some reason there was created an underscored file for these things.
The problem of not being able to read the getter's value was just a bug in my code.
I am using laravel 4.2. After my login code, I redirect to another route for dashboard. But session is not persistent on my dashboard function
This is my code on login function
Session::put('email', $userObject->email);
Session::put('firstName', $userObject->first_name);
Session::put('lastName', $userObject->last_name);
Session::save();
return Redirect::to('/account/dashboard');
if i try to print Session::all() right after Session::save(); I could get the values, But after redirection got nothing. Of course my storage path has the write permissions (0777) Session driver is 'file' Also tried with database, but no luck Any help is highly appreciated, stuck on this for a week almost.
Issue caused because of PHP closing tag on a payment gateway library. It was included in the autoload.
Things to check if session issue comes:
Check for errors using debug true.
Check for exceptions in log file(storage folder)
Do not include PHP closing tag on your files. Before installing a custom library make sure that it doesnot have a closing tag or an error
Do not copy code from websites. if you do so, just paste it to notepad and then copy paste to your editor
I have configured an ecommerce site using Magento, but it is throwing an error.
Mage registry key "controller" already exists
I am not sure what to do. The URL for site is http://musicademy.sweetersinging.com/store/admin
This usually happens if you try and run Mage::run() twice - or specifically, once more after the index.php bootstrap.
Sounds like a (extremely) badly written 3rd party extension or template. It (sadly) wouldn't be the first time I've seen someone execute this within a .phtml file.
Go through the standard debug process, refresh between each.
Move app/code/local to app/code/local.bak
Move app/code/community to app/code/community.bak
Move app/design/frontend/your_custom_package to app/design/frontend/your_custom_package.bak
Once you've found the cause above, then you can start to filter through the filters/dirs to check.
If you have Magefirewall extension installed try disabling at the webserver(by going to magento_root_dir/app/etc/modules/magefirewall.xml) and clear the cache (by deleting all the files/folders in magento_root_dir/var/cache/) if you don't have access to the admin panel. Doing this solved the issue for me on Magento CE 1.9.2.2.
I finally got a basic framework set up and working, however now when I wish to add an action in the 'IndexController.php', it doesn't seem to be working.
I used the following terminal command to add an "about" action:
zf create action about index
It appears that worked, as I opened 'IndexController.php' back up and the new action function is there. And a corresponding 'about.phtml' file was created in 'views/scripts/index', alongside 'index.phtml' that was already there.
When I access the index at
http://localhost3:8888/
the page opens properly.
However if I now try to access the about page at
http://localhost3:8888/index/about
I get a "404 not found" error.
Any ideas?
Looks like a mod_rewrite problem.
Try http://localhost3:8888/index.php/index/about. If it works, then it definitely means that mod_rewrite wasn't correctly set up.
I have generated the Backend Application for the Symfony(1.4 and ORM Propel) project, in my Production env. But on calling the URL as http://www.mydomain.com/backend.php it is showing 404. Is there any config error or something like that..
Look inside your web folder and make sure that backend.php actually exists there, it might have been named something else [typo maybe]. Does mydomain.com work ?
Update
Disable/rename your .htaccess file temporarily and see if this fixes it. It looks like mod_rewrite is catching "backend.php" and passing it on as a module name.
The Problem was due to the Permission of the file i.e backend.php. I have changed the Owner/Group permission and the backend app started working. If any one had this kind of a problem, please check the file permissions, might help!
For rendering 404 page, the third parameter in your front controller must be false.
Like this:
ProjectConfiguration::getApplicationConfiguration('backend', 'dev', false);