I’ve been struggling to fix an issue in my web application (codeigniter3) server (centos) that is already deployed in public domain with SSL enabled that cant seem to open a file in the server itself. I already set the group of the /var/www/html and all of its subfiles and subfolder to my apache web server.
The first error i encountered is this:
Message: imagepng(/var/www/html/temp/04062024_055330_pm_qrcode.png): failed to open stream: Permission denied
I thought it was permission issue, so i proceed to disable selinux to permissive and change the folder permissions in my /var/www/html to 777 then reboot the server(i know its not recommended to turn selinux off and set permission to 777 but i need to know first what is the actual root of the problem before i change it back and fix it) and restart the web server, but i got a new error like this:
file_get_contents(https://example.com/assets/images/Logo.png): failed to open stream: Connection refused
But if i check the file in the server it exist and i can open that png file from my local pc from that public url. FYI, my web application runs smoothly in my local pc (windows os) with the same code. It seems like it’s an access/permission issue in the production server. Please help me, how to fix this?