I've been coding a project for some time. I'm quite new in Symfony2 and php frameworks, but find myself starting to understand it - which is great.
Now however something weird has happened, and I don't know where to start to look.
I was coding a scraper combining Symfony2 and casperjs - it has been working for some time and I was just dusting it off.
Suddenly I get a "connection reset" in Firefox. I try some other routes and they work fine. I try changing the route with a problem, but the same error pops up. I have tried the following:
delete the caches
isolating the casperjs part (works fine)
restart the server
restart apache
checking apache logfiles
checking symfony logfiles
But nothing of the above gives me any clues. Can the problem be with the virtual-host file when it is only a problem for a subpart of the site and not the site in general?
Any ideas is highly appreciated.
Thanks,
Rune
Found the problem in my code.
I did not read the error-log of the project vhost properly.
For others with similar problems the error-log is a great place to start :)
Related
I've got a strange problem going on with Symfony. Today I made brand new project using composer create-project symfony/website-skeleton gall command and right after installation, before doing anything in code I go to the website and the only thing that is said on webprofiler toolbar is "An error occurred while loading the web debug toolbar." I don't even get to see what kind of error is this.
The server I'm running is PHP v. 7.2.3, program is Xampp for Windows.
I thought maybe this default starting page is bugged, so I made some test controller and the error is exactly the same. Have you encountered such problem with latest symfony?
I would never figure it out myself, but adding index.php to browser address resolved the issue.
Much better solution is to use command
composer require symfony/apache-pack
As the .htaccess file is not included in the website-skeleton by default :)
Thanks for pointing me in the right direction guys!
I've been working on setting up correctly my xdebug debugger so I can improve my soft dev process, I manage to get xdebug working with phpstorm for some files that are outside of the project as in the first picture. But when it comes to debug some of the files that are inside of my mvc project (my app folder) I can set my debbuger to work properly and as far as now Im kind of stuck so any help would be welcome.
When I debbug phptest.php it work perfectly because it's an easy mapping
But when I need to debbug something like any php script on my controller folder for example, I can't get to there.
So please any ideas on how to do this.
Regards
Added a new screen shot of my mappings settings as #rafail pointed :)
For further or similar problems, my error was that i added index.php to my excluded paths and because of that I was never be able to debug, I deleted it and now it works fine.
especial thanks to Rafail Akhmetshin for his patience help.
Resume:
Check for exclude paths
Start debugging with phpStorm button
Make sure you are listening on the port
as a note point
make sure to check/uncheck
break at first line on php code
and break on first line when no mapping
Yesterday my Web Profiler stopped working, in Symfony v.3.0.9 (on Win, with WAMP, PHP v7.0.4). Before that it worked just fine and I'm not sure exactly what happened when it stopped.
I first checked the JS errors being reported, then possible errors in dev.log, then tried clearing the cache (with cache:clear), also as an admin and also manually in file system. Nothing helped.
There are no errors returned anywhere and there are no tries from client side to even call it with AJAX. I tried restarting Apache, Wamp & Windows.
Then, I tried composer update, which naturally brought up some new, unrelated issues, and eventually I ended up installing Symfony 3.1, but still no sign of Profiler.
My HTML page does have a body, so the solution here: Web Profiler not showing up in dev doesn't help me. All other mentions of this problem usually lead to some compiling issue, which I don't have (or didn't find it yet).
I also made sure I am running in dev mode, by putting breakpoints in app_dev.php directly.
Has anyone any other/new idea what could be going on?
Addition: I also tried updating Symfony to 3.2, without Profiler appearing.
Addition #2: Just wanted to share, that the only way I can get my Web Profiler to show is, after the cache is rebuilt, go into the var/cache/dev/appDevDebugProjectContainer.php, into the getProfilerService() function and manually comment out the line with:
$instance->disable();
Ugly as hell, but I haven't find any other solution until now. At least, now I see that somehow Symfony decides, based on some internal logic, to actually not show the profiler. At least there is some logic at works.
The final answer to my "mysterious" issue was that someone in the team changed the profiler's setting in the config_dev.yml, and set the:
framework:
profiler:
collect: false
Getting that back to collect:true (which is also its default value) made it all work.
I have just moved a silverstripe install to a new joyent smartos server. Not being familiar with Linux, this was still relatively easy.
I am new to silverstripe as well, but the team here has developed on it for years.
I have the site up and running on the new server, but have not pointed the domain to it until we can thoroughly test it. So I am accessing it from it's ip address. The site displays fine and the sub pages work as well. When I navigate to the '/admin' page, I see a silverstripe page that states the page cannot be found (not an Apache 404). I copied over the .htaccess and the _config.php from the old server, so there should be no issues.
I have done a /dev/build with no errors and I can log in through the security page, but I just cannot get the /admin to come up. I am lost after spending the whole morning surfing google to find the answer. Any help would be greatly appreciated.
UPDATE:: I installed a fresh version of silverstripe into a subdirectory on the same server. Works perfectly, so that rules out any PHP issues.
I have also tried /index.php/admin with no luck.
Thanks,
Ben
I was having this problem as well. None of the solutions I found online worked for me, but I managed to figure it out.
I had apache running as a non-standard user, and the problem turned out to be that the webserver was unable to save session data for the logins.
The solution in my case was to chown root.myuser /var/lib/php/session. Once done, the admin page loaded fine.
If /admin is not loading at all and there is no 404 error, there is a high chance of a PHP error. And that should be logged in the webserver's log file. This will depend on your operating system and probably on the Joyent environment (not familiar with that breed of cloud computing). On Debian, Ubuntu, and some more it's /var/log/apache2/error.log (assuming you're using Apache).
If I had to guess, I'd say the permissions of assets/_combinedfiles/ are bad. The webserver tries to create some combined JS and CSS files there (specifically leftandmain.js and cmsmain.js) and if it fails, you might get the dreaded white page of death in /admin.
I've setup a CakePHP project in Netbeans and use xdebug for debugging. When I start a debugging session, Netbeans stops in the root index.php file on every request. I have to press continue and then my breakpoints are hit.
Is there a way to configure xdebug to avoid this behavior? It's pretty tedious having to hit continue on every request.
Thanks!
Answer in another post: here. Issue was not specific to CakePHP, but rather PHP debugging in general with Netbeans.
Try setting web root folder to APP/webroot. Right click your project and choose properties, then set your source folder to webroot.
Ref: cakePHP debug Netbeans
Hope it helps
Sudhir's answer pointed me into the right direction.
The following worked for me:
Go to project properties.
Click on Run Configuration.
Click browse button next to [Index File] field.
Select app/webroot/index.php.
Breakpoints finally working now!!!
I am sooo happy XD
( PS. I just made the move from Windows to OS X. Whatever installation you are running, make sure you are editing the correct php.ini file. Even PHP veterans like myself sometimes still end up editing the wrong stupid file. )
Paul is correct. This is a netbeans issue, not CakePHP. Uncheck "Stop at First Line".
The larger issue that many people face is getting debugging working in general. If you set the index field as user787301 suggested, then the debugger will launch to webroot/index and throw an error. The solution is to only set Web Root in project properties -> sources as Sudhir suggested.