Welcome Guest, Not a member yet? Register   Sign In
  codeigniter.com/user_guide is not updated
Posted by: defcon0 - 05-01-2024, 02:51 PM - Replies (4)

Hi everybody.
The guys who update the Codeigniter user guide website have stopped in version 4.4.5.
The latest version 4.5.1 has no information about change logs and how to upgrade from previous version.
https://codeigniter.com/user_guide/chang...index.html
https://codeigniter.com/user_guide/insta...ading.html
https://codeigniter.com/user_guide/insta...e_501.html
Please help us with it.
Thank you in advance.


  Request URL 404 Amazon EC
Posted by: robrym - 05-01-2024, 01:04 PM - No Replies

Could someone kindly assist me with the following situation? I've been racking my brains for days and haven't found a solution.
I have been developing on localhost for the past couple of months, recently I uploaded my project to amazon EC, followed the same process as I did on my local installation but for some reason it keeps giving me error 404 if I try to access on of the routes.

This is my home page: http://dev.kosheradmin.com/ and it shows me the basic code igniter page.

And this is one of my routes: http://dev.kosheradmin.com/api/users 
And this is my .htaccess on public:

# Disable directory browsing
Options -Indexes

# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------

# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
        Options +FollowSymlinks
        RewriteEngine On

        # If you installed CodeIgniter in a subfolder, you will need to
        # change the following line to match the subfolder you need.
        # http://httpd.apache.org/docs/current/mod...ewritebase
        # RewriteBase /

        # Redirect Trailing Slashes...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]

        # Rewrite "www.example.com -> example.com"
        RewriteCond %{HTTPS} !=on
        RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
        RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

        # Checks to see if the user is attempting to access a valid file,
        # such as an image or css document, if this isn't true it sends the
        # request to the front controller, index.php
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d


       # Redirect Trailing Slashes...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]

        # Rewrite "www.example.com -> example.com"
        RewriteCond %{HTTPS} !=on
        RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
        RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

        # Checks to see if the user is attempting to access a valid file,
        # such as an image or css document, if this isn't true it sends the
        # request to the front controller, index.php
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]

        # Ensure Authorization header is passed along
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

<IfModule !mod_rewrite.c>
        # If we don't have mod_rewrite installed, all 404's
        # can be sent to index.php, and everything works as normal.
        ErrorDocument 404 index.php
</IfModule>

# Disable server signature start
        ServerSignature Off
# Disable server signature end


  Top 10 PHP Testing Frameworks for 2024 (Dev.to)
Posted by: php_rocs - 05-01-2024, 07:54 AM - Replies (2)

https://dev.to/lambdatest/top-10-php-tes...-2024-4gee


  CL4 Connecting to a Remote AWS Database
Posted by: cx3700 - 04-30-2024, 08:04 PM - Replies (5)

CL 4.5.1 running on AWS Ubuntu with Plesk.

I am trying to connect to a database on our AWS test server from our AWS production server. 

When I connect to a local db on production it works but the remote (test) db connection throws a 500 error, but I can't see what the exact error is. 

Port 3306 is open on both AWS instances. 

I have set allow access from all sources. 

I have tried both the IP address and domain name in the hostname property.

Any advice?


PHP Code:
    public array $default = [
        'DSN'      => '',
        'hostname' => '54.200.xxx.xxx',
        'username' => 'test',
        'password' => 'password123',
        'database' => 'test',
        'DBDriver' => 'MySQLi',
        'DBPrefix' => '',
        'pConnect' => false,
        'DBDebug'  => true,
        'charset'  => 'utf8',
        'DBCollat' => 'utf8_general_ci',
        'swapPre'  => '',
        'encrypt'  => false,
        'compress' => false,
        'strictOn' => false,
        'failover' => [],
        'port'    => 3306,
    ]; 

The Error

Uncaught Error.
{
    "title": "CodeIgniter\\Database\\Exceptions\\DatabaseException",
    "type": "CodeIgniter\\Database\\Exceptions\\DatabaseException",
    "code": 500,
    "message": "Unable to connect to the database.\nMain connection [MySQLi]: Connection refused",
    "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/system/Database/BaseConnection.php",
    "line": 428,
    "trace": [
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/system/Database/BaseConnection.php",
            "line": 575,
            "function": "initialize",
            "class": "CodeIgniter\\Database\\BaseConnection",
            "type": "->"
        },
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/app/Models/ChecklistModel.php",
            "line": 35,
            "function": "query",
            "class": "CodeIgniter\\Database\\BaseConnection",
            "type": "->"
        },
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/app/Controllers/Checklist.php",
            "line": 58,
            "function": "getSiteByPVIN",
            "class": "App\\Models\\ChecklistModel",
            "type": "->"
        },
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/app/Controllers/Checklist.php",
            "line": 48,
            "function": "get_site_information",
            "class": "App\\Controllers\\Checklist",
            "type": "->"
        },
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/system/CodeIgniter.php",
            "line": 943,
            "function": "check_site_information",
            "class": "App\\Controllers\\Checklist",
            "type": "->"
        },
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/system/CodeIgniter.php",
            "line": 503,
            "function": "runController",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        },
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/system/CodeIgniter.php",
            "line": 361,
            "function": "handleRequest",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        },
        {
            "file": "/var/www/vhosts/mydomain.com/install.mydomain.com/public/index.php",
            "line": 79,
            "function": "run",
            "class": "CodeIgniter\\CodeIgniter",
            "type": "->"
        }
    ]
}


  Basic Algorithms
Posted by: InsiteFX - 04-30-2024, 01:56 AM - No Replies

Basic Algorithms

Algorithms are the lifeblood of computing. They are the step-by-step instructions that computers
follow to solve problems, analyze data, and make decisions. Just like recipes, they break down
complex tasks into manageable procedures. Understanding these fundamental algorithms is a stepping
stone to mastering computer science and programming.


  What should I do to show deprecations errors in the output?
Posted by: mywebmanavgat - 04-29-2024, 05:12 PM - Replies (2)

When I examine the logs in a project I am developing with Codeigniter 4, there are Deprecations log records for some of the codes I use.

How can I ensure that codeigniter throws an exception to the screen when it receives such an error, at least when developer mode is on?


  request URL not found
Posted by: jcarvalho - 04-29-2024, 03:52 PM - Replies (7)

Hi guys, I am struggling to make my CI4 app to work properly in an internal LAN linux machine, I have installed Apache,php 8.3 and mySql in xubuntu 22.04 LTS
The rewrite mod is enable in Apache.
I made several tries with a a .conf file in /etc/apache2/sites-enabled, nothing work. My current file is
I do sudo a2ensite and the filename and restart apache2

Code:
<VirtualHost *:80>
    #ServerName 192.168.0.18
  ServerAlias /b2bci4
  DocumentRoot "/var/www/html/b2bci4/public"
    <Directory "/var/www/html/b2bci4">
        Options Indexes FollowSymLinks MultiViews
        #Options  +FollowSymLinks
        AllowOverride All
        #Order allow,deny
        #allow from all
        Require all granted
  </Directory>
</VirtualHost>

I have place an .htaccess file like in the CI4 web site
Code:
#RewriteEngine On
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<FilesMatch "^\.">
    Require all denied
    Satisfy All
</FilesMatch>

In app/Config/App.php I have public string $baseURL = 'http://192.168.0.18/b2bci4/public/';

I can get the login screen but when I click submit to the controller Login/doLogin I got 404... All is working right in my xampp when I start spark server and do http://localhost:8080

Can someone point me what I am doing wrong please?

Thank you all!


  Multiple filters set on a route in routes.php
Posted by: abatrans - 04-29-2024, 11:31 AM - Replies (6)

How would I define different multiple before and after filters for a route in the routes.php config file.
When I define the filters

PHP Code:
$routes->get'beelevels''Beelevels::index', [
   'filter' => [
      'authorize',
      'permissions:view,lookups',
   ]
] ); 
the filter are attached to both before and after, if I define the filters
PHP Code:
$routes->get'beelevels''Beelevels::index', [
   'filter' => [
      'before' => [
         'authorize',
         'permissions:view,lookups',
      ]
   ]
] ); 
I get an exception
Code:
CodeIgniter\Filters\Filters::enableFilter(): Argument #1 ($name) must be of type string, array given, called in ....\system\Filters\Filters.php on line 547
at SYSTEMPATH\Filters\Filters.php:486

The documentation on multiple routes is a bit light.


Question Multiple App with .env
Posted by: piieerre - 04-29-2024, 07:36 AM - Replies (7)

Hello everyone
I am looking to use .env environment files with an instance composed of several applications.
For example, I want to have several applications on the same CodeIgniter instance but with different configurations (Example: baseUrl, database, etc.)
How would you proceed?

My structure on CI v4.5.0:

app1
     Config
     Controllers
     Database
     ..
app2
     Config
     Controllers
     Database
     ..
app3
     Config
     Controllers
     Database
     ..

Thanking you in advance.
Pierre


  Like with Json field
Posted by: motoroller - 04-29-2024, 03:26 AM - Replies (1)

I can use where $builder->where("c.Owner->>'$.id'='$owner'", null, false);

how do same with like?


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Insert in joint table bef...
by kcs
1 hour ago
I built 30 startups in 20...
by InsiteFX
3 hours ago
How to Find & Hire Codeig...
by InsiteFX
3 hours ago
6 hard truths about learn...
by InsiteFX
3 hours ago
4.4.1 to 4.4.8 base_url p...
by kenjis
10 hours ago
CI NEEDS A PROPER DOCUMEN...
by ALTITUDE_DEV
Yesterday, 06:45 AM
Optimize.php make a probl...
by ALTITUDE_DEV
Yesterday, 06:35 AM
CodeIgniter v4.5.0 Releas...
by LP_bnss
Yesterday, 05:16 AM
Gateway time out CI 4.4.1
by kenjis
Yesterday, 03:37 AM
Need PHP Developer
by Sid.M
05-08-2024, 11:21 PM

Forum Statistics
» Members: 87,064
» Latest member: maxicert
» Forum threads: 77,629
» Forum posts: 376,290

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB