Function file get contents not working with EA4

psytanium

Well-Known Member
Jun 6, 2014
183
8
18
Lebanon
cPanel Access Level
Root Administrator
Hello,

After I upgraded to EA4, the function file_get_contents() output some errors on the website.

The "allow_url_fopen
" is enabled in "MultiPHP INI Editor"

Apparently this problem exist on HTTPS websites.

Error:

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /home/user/public_html/product_info.php on line 689

What should I do ?

Thanks
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello,

Could you verify which PHP handler you are using for the affected domain name? Is PHP-FPM enabled for the account? Also, did you enable "allow_url_fopen" in the cPanel MultiPHP INI Editor, or in the WHM MultiPHP INI Editor?

Thank you.
 

lm137

Member
Aug 16, 2017
5
0
1
Earth
cPanel Access Level
Root Administrator
This is only a very recent bug in the EasyApache stack. I have been using EA4 for about a year and everything was fine until approx. 14 days ago when this problem surfaced (presumably after an automatic update).

Advising to switch to PHP-FPM is not a satisfactory resolution of the problem. What if a bug is later introduced in the FPM implementation - will users be advised to switch back to the broken DSO handler?

I tried PHP-FPM, and indeed the bug was not present, but it is not compatible with Apache mod_userdir: static files still work, but php files display "File not found.". I tried changing chdir to "/home" in the pool configuration and restarting php-fpm, but this alone has not done the trick. I suspect there will be something in the Apache configuration, but I don't have much time to find it.

Please advise how I can make mod_userdir work for PHP-FPM, and in any case, please fix the underlying bug with the DSO handler.

Thank you.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @lm137,

The OpenSSL verification failure message that occurs when using the DSO PHP handler is related to the issue discussed on the following thread:

In Progress - Issue with openssl after EA4 update

We'll update that thread as soon as the resolution is published.

Please advise how I can make mod_userdir work for PHP-FPM, and in any case, please fix the underlying bug with the DSO handler.
The CGI, FastCGI, and PHP-FPM PHP handlers are not compatible with the Apache mod_userdir module. This is documented at:

Apache mod_userdir Tweak - Documentation - cPanel Documentation

Thank you.
 

lm137

Member
Aug 16, 2017
5
0
1
Earth
cPanel Access Level
Root Administrator
Hi Michael,

Thank you for your reply and for linking to the thread with the ongoing issue. I hope it is resolved soon. I will use your advice to downgrade ea-libcurl.

I saw a thread with someone managing to configure nginx for mod_userdir to work with FPM. Is this not possible with Apache or is this a cPanel restriction.

Thank you.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
I saw a thread with someone managing to configure nginx for mod_userdir to work with FPM. Is this not possible with Apache or is this a cPanel restriction.
Hello,

There's no support for enabling Mod_Userdir with PHP-FPM in cPanel. While it might be possible with third-party applications such as Nginx, we generally advise using an alternative to Mod_Userdir to access domain names over a temporary URL. Here's a link to one such method:

[Tutorial] Editing your local hosts file to preview sites

Thank you.