CodeIgniter Forums
C4 version 4.4.1 posts me a route problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: C4 version 4.4.1 posts me a route problem (/showthread.php?tid=91735)



C4 version 4.4.1 posts me a route problem - byoosdigital - 09-27-2024

hello devs

i come to you because C4 version 4.4.1 posts me a route problem, i explain:
CONFIG.
debian 12
php 8.3.11
ci4 version 4.4.1
apache 2.4

when launching the application the software executes a javascript script

<code>
//run email queue
$(document).ready(function () {
$.ajax({
type: 'POST',
url: MdsConfig.baseURL + '/Ajax/runEmailQueue',
data: setAjaxData({})
});
});
</code>
the url really exists OK

the routing is in static form

<code>
$postArray = [
//Ajax
'Ajax/runEmailQueue',
'Ajax/getBlogCategoriesByLang',
//Auth
'Auth/sendActivationEmailPost',
];

foreach ($postArray as $item) {
$array = explode('/', $item);
$routes->post($item, $array[0] . 'Controller::' . $array[1]);
</code>
the line url: MdsConfig.baseURL + '/Ajax/runEmailQueue', causes a 404 error

the other routing links also cause a 404 error example $routes->post('login-post', 'AuthController::loginPost');

what is the hardest, is that the application runs on a debian 12 workstation development machine and
on a debian 12 user workstation same problem on a debian 12 VPN server same crash

really thank you for those who can help me
Gabriel


RE: C4 version 4.4.1 posts me a route problem - sikander - 10-15-2024

Can you post your routes
#php spark routes


RE: C4 version 4.4.1 posts me a route problem - captain-sensible - 10-16-2024

normal user on a terminal ,not as root works for me :

Code:
[andrew@darkstar ~]$ cd /srv/http/CI4-CMS
[andrew@darkstar CI4-CMS]$ php spark routes

CodeIgniter v4.5.5 Command Line Tool - Server Time: 2024-10-16 08:44:35 UTC+00:00

+--------+---------------------+------+------------------------------------------+----------------+---------------+
| Method | Route               | Name | Handler                                  | Before Filters | After Filters |
+--------+---------------------+------+------------------------------------------+----------------+---------------+
| GET    | resetPW             | »    | \App\Controllers\Setup::pwForm           | myfilter       |               |
| GET    | setUp               | »    | \App\Controllers\Setup::setUpForm        |                |