Readfile Disabled for Scurity Reason and Image not display.

Taufik Nur Bachtiyar Posted in Beginning Developers 4 months ago

I have error code, my ossn cant display image.
This is bad for me.
All image not display. But I have Error code not same with same problem. Can anyone help me?

I Search for solutions to problems everywhere, but don't find any way to solve them.

> Blockquote[25-May-2019 13:41:48 Asia/Jakarta] PHP WARNING: 2019-05-25 13:41:48 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnProfile/ossncom.php (line 319)
[25-May-2019 13:41:48 Asia/Jakarta] PHP WARNING: 2019-05-25 13:41:48 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnPhotos/ossncom.php (line 397)
[25-May-2019 13:41:48 Asia/Jakarta] PHP WARNING: 2019-05-25 13:41:48 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnProfile/ossncom.php (line 319)
[25-May-2019 13:41:48 Asia/Jakarta] PHP WARNING: 2019-05-25 13:41:48 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnProfile/ossncom.php (line 319)
[25-May-2019 13:41:49 Asia/Jakarta] PHP WARNING: 2019-05-25 13:41:49 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnPhotos/ossncom.php (line 397)
[25-May-2019 13:41:49 Asia/Jakarta] PHP WARNING: 2019-05-25 13:41:49 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnProfile/ossncom.php (line 319)
[25-May-2019 13:44:46 Asia/Jakarta] PHP WARNING: 2019-05-25 13:44:46 (WIB): "exifreaddata(phpeQXDKp): File not supported" in file /home/cenm8357/publichtml/kii/classes/OssnFile.php (line 452)
[25-May-2019 13:44:47 Asia/Jakarta] PHP WARNING: 2019-05-25 13:44:47 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/public
html/kii/components/OssnWall/ossncom.php (line 281)
[25-May-2019 13:54:32 Asia/Jakarta] PHP WARNING: 2019-05-25 13:54:32 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/public
html/kii/components/OssnWall/ossncom.php (line 281)
[25-May-2019 13:55:11 Asia/Jakarta] PHP WARNING: 2019-05-25 13:55:11 (WIB): "exif
readdata(phpMj1s4T): File not supported" in file /home/cenm8357/publichtml/kii/classes/OssnFile.php (line 452)
[25-May-2019 13:55:12 Asia/Jakarta] PHP WARNING: 2019-05-25 13:55:12 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnWall/ossncom.php (line 281)
[25-May-2019 13:58:35 Asia/Jakarta] PHP WARNING: 2019-05-25 13:58:35 (WIB): "readfile() has been disabled for security reasons" in file /home/cenm8357/publichtml/kii/components/OssnWall/ossncom.php (line 281)

Replies
us Bansh33 - Replied 4 months ago

it should be obvious why enabling the function is a security risk for shared hosting providers. the function lets you read the contents of any file, so enabling it could potentially allow one client who has an account on the server read files that belong to somebody else.

of course you could write your own version of the function that outputs the images without using readfile(), depending on what functions you do have access to, but it'd be much better to just get your webhost to enable the function so you don't have to edit the code everywhere that readfile() is used.

Burmese Taufik Nur Bachtiyar Replied 4 months ago

you'll have to get your webhost to enable the readfile() php function. I don't think there's any way around that.

This is work,
But, i read for scurity and potension for readfile() fuction. I change code all code readfile() with echo filegetcontents and succes. And still disabled readfile(). Thanks for your help.

Burmese Taufik Nur Bachtiyar Replied 4 months ago

I'll try it, is it only related to readfile ()?

us Bansh33 - Replied 4 months ago

you'll have to get your webhost to enable the readfile() php function. I don't think there's any way around that.