codeigniter-4

Codeigniter 4: Uploading files with move_uploaded_file

二次信任 提交于 2020-08-20 03:02:07
问题 I just started moving CodeIgniter 3 project to CodeIgniter 4. Everything works fine except file upload. I would like to keep the user uploaded files in /writable/uploads. Below is the code I use to move the uploaded file to desired location. $target_dir = '/writable/uploads/recordings/'; $target_file = $target_dir . basename($_FILES["gfile"]["name"]); $FileType = pathinfo($target_file,PATHINFO_EXTENSION); if($FileType != "mp3") { $vmuploadOk = 1; } else $vmuploadOk = 1; if ($vmuploadOk == 1)

How to host codeigniter4 website on sharehosting? [closed]

半城伤御伤魂 提交于 2020-05-31 04:53:10
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 15 days ago . I have just created a codeigniter4 project and I want to upload it on sharehosting. But my website is not accesible, it gives server error. 回答1: For security reason codeigniter4 folder is made suchg a way that all the libraried and code folder is outside the public folder. By url only

Debug Toolbar in Codeigniter 4 not working

走远了吗. 提交于 2020-04-16 02:53:05
问题 I installed Codeigniter 4.0.2 and did following changes: 1- CI_ENVIRONMENT = development in .env file 2- SetEnv CI_ENVIRONMENT development in .htaccess in public folder 3- Added $useKint = true; in main index.php file in public folder When I open at localhost, welcome page is rendered but no Debug Toolbar is rendered. Am I missing anything? 回答1: The debug toolbar will be there in bottom right cornor with a codigniter code logo Click that in order to open the debug bar. Click the icon you will

How to remove public/index.php/ from url in Codeigniter 4

走远了吗. 提交于 2020-04-08 10:35:09
问题 I want normal URL like www.sample.com/controller not www.sample.com/public/index.php/controller. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ public/index.php/$1 [L] My .htaccess file 回答1: Just do Step 1: In public/ directory, copy index.php and .htaccess to your root project directory. Step 2: In the root project directory, open index.php and edit the following line: index.php -> $pathsPath = FCPATH . '../app/Config/Paths.php';

How to debug Codeigniter 4

情到浓时终转凉″ 提交于 2020-03-23 10:43:28
问题 whatever error occurs in Codeigniter 4 Its always showing default message How to get exact error message in Codeigniter 4 回答1: Rename the env file as .env , then removed # from CI_ENVIRONMENT and modified CI_ENVIRONMENT = production into CI_ENVIRONMENT = development 回答2: go to .env file in base file uncomment #CI_ENVIRONMENT = development to CI_ENVIRONMENT = development 来源: https://stackoverflow.com/questions/60501607/how-to-debug-codeigniter-4