Welcome Guest, Not a member yet? Register   Sign In
Image not showing in codeigniter 4
#9

(This post was last modified: 11-06-2019, 11:36 PM by John_Betong.)

Try this:
1. index.php -> echo $PATH = getcwd(); die;
2. make a note of the $PATH;
3. create this folder: $PATH .'\assets\avatar'
4. save this avatar file: $PATH .'\assets\avatar\avatar_1.jpg'
5. test: index.php -> echo '<img src="/assets/avatar/avatar_1.jpg" alt="#" width=333 height=333 >';

Edit:
If that does not work and the image file is saved in the correct path then there is most likely to be a problem with .htaccess file. If so temporarily rename .htaccess file and try again.

Also in index.php temporarily add these lines:
<?php
declare(strict_types=1);
error_reporting(-1);
ini_set('display_errors', '1');

echo '<img src="/assets/avatar/avatar_1.jpg" alt="#" width=333 height=333 >';
die;
Reply


Messages In This Thread
Image not showing in codeigniter 4 - by durairaj - 11-06-2019, 12:19 AM
RE: Image not showing in codeigniter 4 - by John_Betong - 11-06-2019, 11:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB