Hi Everyone,
I was building a cPanel plugin and now that I have everything ready and started to do some real life tests I come across a very strange thing that I hope you can help me with.
Case:
1. I have a form in my cPanel plugin that allows one to upload a file
2. When a file is uploaded I decompress it on the other end and set up everything I need
Result:
Everything works perfectly if you have a file that is 1MB or so (meaning the upload only takes a few seconds).
Problem:
If you select a file that is over 5MB (or any file that takes more then 5 seconds to upload) it immediately throws the following error:
Warning: fsockopen() [function.fsockopen]: unable to connect to unix:///home/xxxx/.cpanel/live-engine-connector-_rVwM_7CvU.sock:-1 (Connection refused) in /usr/local/cpanel/php/cpanel.php on line 145
There was a problem connecting back to the cPanel engine. Make sure your script ends with .live.php or .livephp
Note:
I see that every time you refresh your page there is a new socket file coming from getenv('CPANEL_PHPCONNECT_SOCKET') and this file gets automatically deleted once your script finishes but because this error the socket file is kept in the /home/xxxx/.cpanel directory and it has the right permissions set (user/group/read) but it seems it's not usable anymore.
Could someone please help me out with this problem. It seems like a timeout for the socket meaning as the form is submitted the cPanel creates the socket for the php but till the php script starts to run (because it is waiting for the file upload) the socket gets reset or something like that?
Hope you can help.
Thanks!
Julius
I was building a cPanel plugin and now that I have everything ready and started to do some real life tests I come across a very strange thing that I hope you can help me with.
Case:
1. I have a form in my cPanel plugin that allows one to upload a file
2. When a file is uploaded I decompress it on the other end and set up everything I need
Result:
Everything works perfectly if you have a file that is 1MB or so (meaning the upload only takes a few seconds).
Problem:
If you select a file that is over 5MB (or any file that takes more then 5 seconds to upload) it immediately throws the following error:
Warning: fsockopen() [function.fsockopen]: unable to connect to unix:///home/xxxx/.cpanel/live-engine-connector-_rVwM_7CvU.sock:-1 (Connection refused) in /usr/local/cpanel/php/cpanel.php on line 145
There was a problem connecting back to the cPanel engine. Make sure your script ends with .live.php or .livephp
Note:
I see that every time you refresh your page there is a new socket file coming from getenv('CPANEL_PHPCONNECT_SOCKET') and this file gets automatically deleted once your script finishes but because this error the socket file is kept in the /home/xxxx/.cpanel directory and it has the right permissions set (user/group/read) but it seems it's not usable anymore.
Could someone please help me out with this problem. It seems like a timeout for the socket meaning as the form is submitted the cPanel creates the socket for the php but till the php script starts to run (because it is waiting for the file upload) the socket gets reset or something like that?
Hope you can help.
Thanks!
Julius
Last edited: