Noticed a big massive loophole in my symfony site. If I visit
localhost:8080/frontend_dev.php/module [naturally the indexSuccess.php file gets executed]
I get the desired file... however, if I go onto:
localhost:8080/module, then it returns a 500 internal server error.
This is obviously going to be a biiiig problem once I migrate to production [heck, I have migrated and it is the problem].
I am sure I am missing a trick here, just what I am not sure!
Thanks!
Not sure if this is a real question, but why would you think not including the controller would work?
# wrong
localhost:8080/module
# right - By default Controller needs .php extension
localhost:8080/frontend.php/module
Also, you can check the 500 internal server error by tailing your php error_log, assuming you have logging turned on.
Related
I just got a typo3 website and need to transfer to an other domain.
Is it enough to copy all the folders (except typo3temp?) to the new place?
First I just changed baseurl in ts but it didn't do anything..
Should I do anything with the database when it still on the same server?
In case your question is about "cloning" a complete TYPO3-system an rsync/copy of the whole folder (yes including typo3temp) is the best idea, as this works on all versions, everything else (like excluding typo3temp) depends a whole lot on your TYPO3 expertise to resolve. The database needs to be copied as well. If you need to change db-name or db-credentials on the new system you need to change them in
typo3conf/LocalConfiguration.php
As soon as you have done this Install Tool and Backend should work: At first try the Install Tool:
https://my.new.domain/typo3/install/
If that doesn't work your problem is with the webserver configuration or dns.
If that works (and the reports there show no errors), try the Backend:
https://my.new.domain/typo3/
In case your question is about which changes are necessary to your TYPO3-installation if domain changes and the web server itself is configured correctly, then there are probably two things you need to change, in order to make the frontend work (although both cases might be omitted, depending on your configuration):
sys_template record, if any of those use absRefPrefix or baseurl. If you have access to the MySQL-Database a
SELECT pid FROM sys_template WHERE config LIKE "%baseurl%" OR "%absRefPrefix";
might help finding the template, however these template configuration might also be stored in files (typically in fileadmin/templates/**)
sys_domain records, a MySQL
SELECT pid FROM sys_domain;
might uncover where those are stored
However these changes are only necessary to enable the frontend to work.
Add a domain record in the backend. And while you don't need the content of the typo3temp folder, make sure the folder actually exists.
When you go to the new domain name in your browser, what happens?
Do you get redirected to the old domain? If so, maybe there is an .htaccess redirect happening.
Do you get to the new domain, but if you click on a link end up on the old one?
Do you get an error? If so, what is the error?
Does something else happen?
I am using homestead as my development environment, I turned on the hhvm option for the site
sites:
- map: homestead.app
to: /home/vagrant/Code/wheremyprojectis
hhvm: true
I found that when there is an exception, everything is fine, but If I forgot to use namespace, got syntax error in the blade templates, I got nothing, blank page. I go check the logs and still nothing, the debug option is true. It's quite frustrating until I turned off the hhvm option.
I know it is not a big deal, but I still want to know is there any way to fix this?
I experienced the same problem. I searched around and found that it seems to be intentional:
https://github.com/facebook/hhvm/issues/4818
https://github.com/facebook/hhvm/issues/2571
Now you can poke through the github issues mentioned above, as well as these stackoverflow questions:
Display fatal/notice errors in browser
hhvm-fastcgi + nginx how to make it display fatal errors in the browser
laravel 5 show blank page on server error (and no laravel log), running with hhvm and nginx
For the time being, it ultimately boils down to writing your own handler, which isn't too bad. You can also tail the errors at /var/log/hhvm/error.log. Any errors that you intentionally want going to the browser you could of course handle using Laravel's error handling and logging.
UPDATE:
I reported this issue(and a fix) to the Laravel github here:
https://github.com/laravel/framework/issues/8744
So I'm trying to make a redirect in my routes.rb. I'm getting an error when I leave off my domain.
match "/partners/" => redirect("/partners.html")
Navigating to /partners/ gives this error page:
URI::InvalidComponentError
bad component(expected host component): frontend_rails.dev
However, it does work if I put our full domain in the redirect.
match "/partners/" => redirect("http://example.com/partners.html")
But for my dev server I don't like links to go to our production server. According to the rails doc, this should be added automatically:
In all of these cases, if you don’t provide the leading host (http://www.example.com), Rails will take those details from the current request.
Any ideas why it's not liking my relative redirects? Thanks!
Almost a year later and I finally realized what the problem was. It actually WAS a bad URI. The repo in GitHub was called frontend_rails. I used the Pow server, which gives you a host based on your folder name (which, when you check out a project defaults to the name of the GitHub repo), so http://frontend_rails.dev.
However, underscores technically aren't allowed in a URI. This was tripping up the URI gem. I symlinked my project frontend_rails to frontend-rails and now it works. Voilà !
Sometimes in production, some piece of code with a specific input might break with a 500 error. How can I configure Rails 3 to automatically send the traceback to an email when there's a 500 error?
Check out ExceptionNotification. That's exactly what it was designed for.
And if you want even better visibility I would suggest you set up an Error Catcher. It's basically the upgraded version of ExceptionNotifier. Airbrake works well but I prefer the open source equivalent Errbit. https://github.com/errbit/errbit
You may try this one ExceptionLogger . It allow you log exceptions inside a database table.
Can someone point me to the code or a way that I can say print to screen which admin template is being used?
It happens many a time when I am replacing a admin template for an model that I add the template and hit the page and bham... still the same template.
Usually its a case issue or something like that... but it takes me a while if I get stumped to realise what my issue is.
Can anyone suggest an approach, be it put print statements in django code to show which template is getting resolved?
Regards
Mark
Use the django-debug-toolbar, it has a tab that shows all the template_s_ (plural) that are used.
If you run Django's development server from the command line, you can definitely just use print statements to find out which template is being used. You can also use the FireBug plugin for Firefox to figure out what the server is sending back to you.