views:

49

answers:

1

Hi, I'm trying to integrate Goutte http://github.com/fabpot/Goutte into my existing symfony 1.4 project and am running into a problem.

I have everything working on my local wamp server, here are the two lines in question:

require_once('path_to_goutte.phar');
$client = new Goutte\Client();

Now to debug I've put a print statement before and after the require_once statement and the second print statement doesn't get fired off. No error logs are generated - the error is silent and very frustrating.

Any ideas as to why this might be happening?

Thanks in advance

+1  A: 

"No error logs" is something that should be fixed! Check your php configuration (the php;ini file). Is the log_errors setting set to on?

greg0ire
Thanks for the heads up! It actually wasn't on. I've turned it on and checked out the logs but there is nothing there other than some missing images. Any ideas?
Marc
Check your error_reporting setting is set to -1 . Explanation here : http://fr.php.net/manual/fr/function.error-reporting.php
greg0ire
I set it, and output the setting right before just to make sure it's -1, and there are still no errors reported in the log for it. If I take out the require_once, the second print will print. This is very bizarre.
Marc
Use the trigger_error() with different levels as second argument and make sure every error message is logged... and check whether your error_log setting, it should tell to which file PHP errors are logged (missing images are perhaps only apache 404 errors, no php involved)
greg0ire
Hi there, thanks for working with me. I just tested E_USER_NOTICE, E_USER_WARNING, and E_USER_WARNING. Any other ideas? It's very strange that the .phar file would be included on my windows machine but not on my linux and not throw an error. BTW my windows machine is running php 5.3, my linux 5.3.2 - not that it should make a difference though...
Marc
Hi, I tried this piece of code on my server `<?php require_once('nonexistant_file.php');` , and I get a warning and a fatal error. Check you get the same thing in your log file. BTW, you said you tested some levels, but you did not specify the results, are they positive? I mean, do you get error messages in your log file? Also, check you get "Syntax Ok" when running the command `apache2ctl -t`
greg0ire
Hi Greg, I did see the errors in my log file. I ended up uninstalling apache, php, mysql, memcache, and apc - then reinstalling and rewriting the configuration files - and then cloning everything to my production. That has solved the problem. However, I still don't know why I was getting the error I did. I changed things around a bit with regards to my hosts file and how I'm serving up the content - perhaps that's what did it. Thanks so much for trying to help me though.
Marc
Glad you finally got your problem solved! Please upvote my answer it you found it useful :)
greg0ire
Bravo, thanks for taking the time. Upvoted.
Marc