failed loading cafile stream: `cacert.crt'

1,259 views
Skip to first unread message

bes...@gmail.com

unread,
Jan 8, 2018, 1:40:25 PM1/8/18
to PHP Desktop
Dear all , i am using CURl,file_get_contents to connect to https website
i set the settings in the php.ini

openssl.cafile='cacert.crt'


and copy cacert.crt to the root of php directory.

it report an error, but when i set the file in C:\ and set the path

openssl.cafile='C:\cacert.crt'

it works , so what is the correct path i have to set in the php.ini to include cacert.crt within the php folder ?

Czarek Tomczak

unread,
Jan 8, 2018, 2:07:55 PM1/8/18
to PHP Desktop
Looks like a general PHP issue, you should google. From what you write it seems that an absolute path is required. If so then your app installer (Inno Setup, NSIS - see KB wiki) could write that absolute path to php.ini during installation of app.

bes...@gmail.com

unread,
Jan 8, 2018, 2:44:46 PM1/8/18
to PHP Desktop
I am using Portable File Generator "Enigma Virtual Box" , which is not an installer by it self.

is there any other way , since there is no global variable i can set in the php.ini

eg:%Temp FOLDER% - Temporary folder;

Czarek Tomczak

unread,
Jan 8, 2018, 2:47:06 PM1/8/18
to PHP Desktop
Maybe can you set it in a php script using ini_set() ?
Reply all
Reply to author
Forward
0 new messages