I've wrote a simple api that bring together data from one server to the other. its a very simple $_GET
based api where all the data is appended as GET data to the url.
So I get something like:
http://example.com/api.php?param1=afdsa¶m2=TTTT&....
etc.
In order to call it I use file_get_contents($url);
first of all - I don't really need the content of the reply. I just need to "touch" the url so it will kick into action.
I had problems with my hosting (shared, justhost) and I've moved along to a VPS. I've started to get timeout on my api calls and when I've checked the apache error.log I've saw:
"failed to open stream: File name too long in ..."
And indeed - the $url
string is around 450 chars.
The question is - where do I change the setting for the file length. Its not the same as the Hard drive file system because my own computer get the same string with no problems and with no errors. also - the shared hosting did not have any problems with that url.
The VPS runs ubuntu 10.04 lts with PHP Version 5.3.2-1ubuntu4.9
Appreciate any help, been sitting on that for two days
SOLVED
Well you know how is it when you think you know where the problem is but its not? well - that was the problem.
I've rewritten my API so all it will do is print_r($_GET);
and what do you know - it worked fine.
So I've started to add the lines one by one and found out that what stacked the script was a php mail function. Why? I don't know, maybe mail setting are not correct - but now, when I've commented out the mailing - all works fine.
It still doesn't explain my "file to long" error, but never mind. Thanks to you all