php - Upload path and $_SERVER['DOCUMENT_ROOT'] not working in cpanel with codeigniter

Solution:
why not try using relative path from index.php as all of your code will be executing from index.php. So try
$path = 'admin/sliderImages/';
$files = scandir($path); // get all file names
Answer
Solution:
start with config file
$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'];
This will make your upload path to bebase_url('admin/sliderImages');
Let CI sort the urls and don't forget to endit the .htaccess file to reflect server configs
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: target class [commandmakecommand] does not exist.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.