codeigniter-4

Codeigniter 4: Cannot access the page with apache mode_rewrite

家住魔仙堡 提交于 2021-02-20 03:40:53
问题 I installed Codeigniter 4.0.0.rc3 on my local computer using Wampserver and created a 'people' controller. I can access the page using this address: http://127.0.0.1/election/index.php/people But not without 'index.php': http://127.0.0.1/election/people And this is the error: The requested URL /Projects/Web/election/public/index.php/people was not found on this server. .htaccess is in the public directory and is working because the error shows index.php in the path. This is my htaccess: #

Whoops! We seem to have hit a snag. Please try again later

末鹿安然 提交于 2021-02-18 10:22:51
问题 Whoops! We seem to have hit a snag. Please try again later. Codeigniter 4 shows an error when I run the CI4 application, How I resolve? Changes: public $baseURL = 'http://ci.local'; public $baseURL = 'http://localhost:8080'; public $indexPage = ''; 回答1: This work for me try it Go to app directory then to boot directory you will see production.php file. That is: app => Config => Boot => production.php Change the ini_set('display_errors', '0') to ini_set('display_errors', '1') . Warning: When

Assets won't load if base url contains port number - codeigniter 4

删除回忆录丶 提交于 2021-02-11 13:54:26
问题 I am running php spark serve to run a codeigniter 4 app locally. if my $base_url have a port number, all my assets wont load, but it will if i remove the port number This wont load my assets public $baseURL = 'http://localhost:8080/folder_name'; This will load my assets public $baseURL = 'http://localhost/folder_name'; Any suggestion as to why and how to fix it? 回答1: i hope my answer is not late. since codeigniter 4 used spark server and there is many update. Just put your asset file to

CodeIgniter 4… documentRoot is not in public… htaccess is not working

早过忘川 提交于 2021-02-10 18:45:29
问题 I am starting to dabble in CodeIgniter 4. Completed a simple app. On local, I have the documentroot setup to be /public/ where as on the product hosting environment, I am unable to set the documentroot to be in /public/. Instead it is in /root. So the structure is like so: /root ../admin ../app ../system ../public ../.htaccess ../index.php I've moved the htaccess from the public folder to the root level. # Disable directory browsing Options All -Indexes # -------------------------------------

CodeIgniter 4… documentRoot is not in public… htaccess is not working

杀马特。学长 韩版系。学妹 提交于 2021-02-10 18:40:47
问题 I am starting to dabble in CodeIgniter 4. Completed a simple app. On local, I have the documentroot setup to be /public/ where as on the product hosting environment, I am unable to set the documentroot to be in /public/. Instead it is in /root. So the structure is like so: /root ../admin ../app ../system ../public ../.htaccess ../index.php I've moved the htaccess from the public folder to the root level. # Disable directory browsing Options All -Indexes # -------------------------------------

Force downloading file in php

家住魔仙堡 提交于 2021-02-10 14:44:57
问题 I have just finished my project and move to live server mean-while all contents and program are working very well on my Development section (XAMPP) and I have also moved this project to test on a live shared hosting server (Namecheap). all work good then until I purchase a VPS server and installed cpanel. When I uploaded my project and using php 7.3, things no longer are working right for file forcing download. Here is my code. //* Download item zip files public function downloadItemZipFiles(

Force downloading file in php

倖福魔咒の 提交于 2021-02-10 14:37:14
问题 I have just finished my project and move to live server mean-while all contents and program are working very well on my Development section (XAMPP) and I have also moved this project to test on a live shared hosting server (Namecheap). all work good then until I purchase a VPS server and installed cpanel. When I uploaded my project and using php 7.3, things no longer are working right for file forcing download. Here is my code. //* Download item zip files public function downloadItemZipFiles(

CodeIgniter: 4.0.3 FPDF - error Class 'FPDF' not found

旧城冷巷雨未停 提交于 2021-01-29 14:18:04
问题 I am trying to generate a PDF document from CodeIgniter: 4.0.3 using fpdf library. I have copied fpdf library in app/ThirdParty folder. I have included library reference at the top of controller like this. <?php namespace App\Controllers\Purchase; namespace App\ThirdParty\fpdf; use CodeIgniter\Controller; use FPDF; I have created a class in the controller to extend FPDF to include header and footers like this. class PDF extends FPDF { function Header() { } } I generate the pdf like this. $pdf

Codeigniter 4 Pagination with join tables showing error

廉价感情. 提交于 2021-01-29 06:44:34
问题 I am working on codeigniter project. I am showing news table with join left news category and paginate. When I tried the below code I get an error Call to undefined method CodeIgniter\Database\MySQLi\Builder::paginate() . How to show news data with join and pagination? $db = \Config\Database::connect(); $news_tbl = $db->table('tbl_news')->join('tbl_category', 'tbl_news.category_id = tbl_category.category_id'); $data['news_fetched'] = $news_tbl->paginate(10); $data['pager'] = $news_fetched-

imap_open(): Couldn't open stream for hostgator server {mail.mydomain.com:993/imap/ssl}INBOX in codeigniter

随声附和 提交于 2021-01-28 14:05:36
问题 I am working in codeigniter framework using imap library. I want to get all mails from my mail server into my web app. My code is working fine when i am using imap_open("{imap.gmail.com:993/imap/ssl}INBOX", my_email, my_password); but whenever I tried to get access of my hostgator mail server I got these type of errors. 1: imap_open(): Couldn't open stream {mail.mydomain.com:993/imap/ssl}INBOX 2: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed. (errflg=1). 3: