View Full Version : WSDL cache error
I'm setting up a new site and have moved files from my existing site to the new domain. Even though the original site works perfectly I get the following errors on the new site:Warning: fopen(/tmp//wsdlcache-0fd1349d9516d87404646f9ce1147347.lock) [function.fopen]: failed to open stream: Permission denied in /home/shopper/public_html/includes/soap/classes/nusoap/class.wsdlcache.php on line 119
Warning: flock(): supplied argument is not a valid stream resource in /home/shopper/public_html/includes/soap/classes/nusoap/class.wsdlcache.php on line 121
Can anyone remember the solution to this problem? It's been ages since I set up the first site and I can't remember what this all means!
Confuscius
26-10-07, 11:10
Hi Steve
I remember hitting a similar issue and also the fact that the 'cacheing issue' was never really resolved with a definitive answer from DigiWin despite numerous requests.
There were two issues for me. Firstly, you have to remove the extra '/' that is not needed and also include the full SERVER root path to the file in question in the php4client file. I made one more small change to give me the following so that I do not forget to do it on new sites:
$oWsdl = false;
// ************* EDIT THIS *****************
$gPath = '/home/USERNAME/public_html/tmp/';
// ************* EDIT THIS *****************
// enable WSDL caching
if (is_writable($gPath)) {
// set lifetime to a day
$oWsdlCache = new wsdlcache($gPath, 86400);
$oWsdl = $oWsdlCache->get(PS_WSDL);
// last attempt at caching
if (empty($oWsdl)) {
$oWsdl = new wsdl(PS_WSDL);
$oWsdlCache->put($oWsdl);
}
}
// can't cache, load normally
else {
$oWsdl = new wsdl(PS_WSDL);
}
I think that was what I did!
Paul
Thanks Paul.
I did come across a similar post (probably from you) when I searched the forums but this suggestion wasn't confirmed as suitable by the SW guys in the thread and obviously never was.
Does your solution actually write a file out to that directory?
I tried creating the tmp dir and removing the trailing slash but the error didn't go away. What did work was just using 'tmp', but I'm guessing this just means the first 'IF' returns false and wsdl caching is disabled. More of a hack than a solution.
I have no clue about WSDL and if not caching it is a bad thing but if it means there are no errors on my site then no WSDL caching it is. If someone from SW wants to chip in and set us straight please do!
Confuscius
26-10-07, 12:04
"Does your solution actually write a file out to that directory?" - yes, it does.
In fact it creates two files - for example:
wsdlcache-0fd1349d9516d87404646f9ce1147347 - 174k
AND
wsdlcache-0fd1349d9516d87404646f9ce1147347.lock - 0k
Check tmp permission and if you changed the path then you should get that reflected in the message ( the bit that I do not understand is that although I am using php5, SW still uses the php4 file ).
Just face the fact that there appears to be no 'technical' input into this forum by Digiwin, which is somewhat frustrating at times.
I will dig deeper later on what I actually did rather than memory guessing!
Paul
For now I'm going to leave it alone since the error messages have gone and that was the main concern. If at some point someone suggests there is a benefit to be had from WSDL caching then I'll follow your suggestion.
Thanks for your help Paul.