Image not showing in codeigniter 4 |
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; |
Welcome Guest, Not a member yet? Register Sign In |