• 404 in CodeIgniter3 application

    From Jivanmukta@jivanmukta@poczta.onet.pl to comp.lang.php on Wed Apr 12 18:25:23 2023
    From Newsgroup: comp.lang.php

    I am trying to solve a problem of 404 in my COdeIgniter3 application.
    The problem occurs because of problem in core/Codeigniter.php:
    echo 'BEFORE call_user_func_array';
    var_dump($CI, $method, $params);
    call_user_func_array(array(&$CI, $method), $params);

    // Mark a benchmark end point
    $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
    echo 'AFTER call_user_func_array ';

    BEFORE is displayed, AFTER is not displayed.
    var_dump displays object Main, method index, empty array params.
    I have a controller
    class Main extends MY_Controller {
    public function index() {
    ...

    In folder /home/robert/Projekty/praca/application/controllers I have
    file Main.php
    In file /home/robert/Projekty/praca/application/config/routes.php I have:

    $route['default_controller'] = 'main';
    $route['404_override'] = '';
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From J.O. Aho@user@example.net to comp.lang.php on Thu Apr 13 07:40:04 2023
    From Newsgroup: comp.lang.php

    On 4/12/23 18:25, Jivanmukta wrote:
    I am trying to solve a problem of 404 in my COdeIgniter3 application.
    The problem occurs because of problem in core/Codeigniter.php:
    echo 'BEFORE call_user_func_array';
    var_dump($CI, $method, $params);
    call_user_func_array(array(&$CI, $method), $params);

    // Mark a benchmark end point
    $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
    echo 'AFTER call_user_func_array ';

    BEFORE is displayed, AFTER is not displayed.

    I guess it hard fails at call_user_func_array

    var_dump displays object Main, method index, empty array params.

    If the method called don't need parameters

    I have a controller
    class Main extends MY_Controller {
    public function index() {

    Most likely something that goes wrong when you call index(), debug that one.


    In folder /home/robert/Projekty/praca/application/controllers I have
    file Main.php
    In file /home/robert/Projekty/praca/application/config/routes.php I have:

    $route['default_controller'] = 'main';

    Not sure if it's case sensitive, never used CodeIgniter3, you may need
    to change to Main.
    --
    //Aho

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Arno Welzel@usenet@arnowelzel.de to comp.lang.php on Thu Apr 13 09:22:32 2023
    From Newsgroup: comp.lang.php

    Jivanmukta, 2023-04-12 18:25:

    I am trying to solve a problem of 404 in my COdeIgniter3 application.
    The problem occurs because of problem in core/Codeigniter.php:
    echo 'BEFORE call_user_func_array';
    var_dump($CI, $method, $params);
    call_user_func_array(array(&$CI, $method), $params);

    // Mark a benchmark end point
    $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
    echo 'AFTER call_user_func_array ';

    BEFORE is displayed, AFTER is not displayed.

    Without any error message it's impossible to tell what the problem is.
    However if you want to do benchmarking this is done in a different way:

    <https://codeigniter.com/userguide3/libraries/benchmark.html>

    To find out what the real problem is, check the error logs of PHP and/or
    the webserver or enable error reporting in php.ini and try to call the
    URL again:

    error_reporting = E_ALL

    Also using XDebug (<https://xdebug.org>) with an IDE like PHPStorm or
    VSCode helps a lot. This is often already included in current Linux distributions and just has to be enabled.
    --
    Arno Welzel
    https://arnowelzel.de

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jivanmukta@jivanmukta@poczta.onet.pl to comp.lang.php on Fri Apr 14 11:24:04 2023
    From Newsgroup: comp.lang.php


    Address http://localhost/~robert/praca/employee/list_offers works fine.
    Address http://localhost/~robert/praca/main/index doesn't work (404).

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From doctor@doctor@doctor.nl2k.ab.ca (The Doctor) to comp.lang.php on Fri Apr 14 11:50:16 2023
    From Newsgroup: comp.lang.php

    In article <u1b63k$vg4p$1@portraits.wsisiz.edu.pl>,
    Jivanmukta <jivanmukta@poczta.onet.pl> wrote:

    Address http://localhost/~robert/praca/employee/list_offers works fine.
    Address http://localhost/~robert/praca/main/index doesn't work (404).


    FYI Localhost gets you nowhere!
    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b She didn't want to be evil, but by denying her nature she adopted it. -unknown Beware https://mindspring.com
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From J.O. Aho@user@example.net to comp.lang.php on Fri Apr 14 19:12:56 2023
    From Newsgroup: comp.lang.php

    On 4/14/23 11:24, Jivanmukta wrote:

    -a-a-a Address http://localhost/~robert/praca/main/index doesn't work (404).

    and the logged error message was?
    --
    //Aho
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Angel@heyeeeeeeeeeeeeeeeeeee@gmail.com to comp.lang.php on Sat Apr 15 11:35:45 2023
    From Newsgroup: comp.lang.php

    Check out:
    raCraCraCraCraCraCraCraCkohtumispaik2.freehostpro.com/a.php raCraCraCraCraCraCraCraCkohtumispaik3.66ghz.com/a.php raCraCraCraCraCraCraCraCkohtumispaik4.medianewsonline.com/a.php raCraCraCraCraCraCraCraCaaaaaaaaaaaaaaaar.medianewsonline.com/firstpage.php raCraCraCraCraCraCraCraCthemostconfortabletalkplace.medianewsonline.com/a.php See You on the addresses......
    On Wednesday, April 12, 2023 at 6:25:32rC>PM UTC+2, Jivanmukta wrote:
    I am trying to solve a problem of 404 in my COdeIgniter3 application.
    The problem occurs because of problem in core/Codeigniter.php:
    echo 'BEFORE call_user_func_array';
    var_dump($CI, $method, $params);
    call_user_func_array(array(&$CI, $method), $params);

    // Mark a benchmark end point
    $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); echo 'AFTER call_user_func_array ';

    BEFORE is displayed, AFTER is not displayed.
    var_dump displays object Main, method index, empty array params.
    I have a controller
    class Main extends MY_Controller {
    public function index() {
    ...

    In folder /home/robert/Projekty/praca/application/controllers I have
    file Main.php
    In file /home/robert/Projekty/praca/application/config/routes.php I have:

    $route['default_controller'] = 'main';
    $route['404_override'] = '';
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Angel@heyeeeeeeeeeeeeeeeeeee@gmail.com to comp.lang.php on Sat Apr 15 11:35:55 2023
    From Newsgroup: comp.lang.php

    Check out:

    raCraCraCraCraCraCraCraCkohtumispaik2.freehostpro.com/a.php raCraCraCraCraCraCraCraCkohtumispaik3.66ghz.com/a.php raCraCraCraCraCraCraCraCkohtumispaik4.medianewsonline.com/a.php raCraCraCraCraCraCraCraCaaaaaaaaaaaaaaaar.medianewsonline.com/firstpage.php raCraCraCraCraCraCraCraCthemostconfortabletalkplace.medianewsonline.com/a.php


    See You on the addresses......


    On Friday, April 14, 2023 at 7:13:06rC>PM UTC+2, J.O. Aho wrote:
    On 4/14/23 11:24, Jivanmukta wrote:

    Address http://localhost/~robert/praca/main/index doesn't work (404).
    and the logged error message was?

    --
    //Aho
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jivanmukta@jivanmukta@poczta.onet.pl to comp.lang.php on Thu Apr 27 16:38:00 2023
    From Newsgroup: comp.lang.php

    W dniu 14.04.2023 o-a11:24, Jivanmukta pisze:

    -a-a-a Address http://localhost/~robert/praca/employee/list_offers works fine.
    -a-a-a Address http://localhost/~robert/praca/main/index doesn't work (404).

    My mistake. I was calling 404 in my code. Sorry. Problem solved.
    --- Synchronet 3.21d-Linux NewsLink 1.2