Welcome Guest, Not a member yet? Register   Sign In
"curl" makes form submission result in 404
#21

[eluser]@li[/eluser]
Perhaps you were saying something else and I misinterpreted it. You can send me the code and I can test it on my side as well if you want.

It would be interesting if you hacked the show_404() function to print_r() $_POST and $this->uri->uri_string() instead of showing a 404 message. That way we might be able to trace the error. The function should be in system/libraries/Exceptions.php. Just comment out the show_404 function and replace it with something like:

Code:
function show_404($page='')
    {
        echo "Page: <b>$page</b> <br><br>";
        echo "<pre>".print_r($_POST)."</pre>";
        echo '<br>';
        echo $this->uri->uri_string();
        
    }
#22

[eluser]Bramme[/eluser]
And it works on localhost. So it's gotta be something server related? I'll try that 404 thing first!

The show_404 modification result

editted the function to
Code:
function show_404($page='')
    {
        $ci =& get_instance();
        echo "Page: <b>$page</b> <br><br>";
        echo "<pre>".print_r($_POST)."</pre>";
        echo '<br> Uri string: ';
        echo $ci->uri->uri_string();
        die();
        
    }
Source result:
Code:
Page: <b>content/500.shtml</b> <br><br>Array
(
)
<pre>1</pre><br> Uri string: /500.shtml

Is CI trying to show me an Internal Server Error 500 message, but simply fails showing it and shows the 404 instead?


edit: pretty sure now it's related to the server: the same bug appears with other forms sidewide too, accross controllers views etc.
#23

[eluser]@li[/eluser]
You're getting the 500 internal server error by apache when this script runs. Which means there is a problem with your apache settings. Do you keep an error_log file on your apache system? If so, please post the contents of the last few error messages here.

You may also want to contact your web host's technical support and ask about this.

Let us know!
#24

[eluser]@li[/eluser]
Check your apache error log files and post here!
#25

[eluser]Bramme[/eluser]
The site has got Cpanel 10, I see an error log module but this shows nothing relevant I think.

Code:
[Sun Oct 12 20:19:35 2008] [error] PHP Fatal error:  Call to a member function uri_string() on a non-object in /home/mickm/public_html/_system/libraries/Exceptions.php on line 106
[Sun Oct 12 20:19:34 2008] [error] PHP Fatal error:  Call to a member function uri_string() on a non-object in /home/mickm/public_html/_system/libraries/Exceptions.php on line 106
[Sun Oct 12 20:19:34 2008] [error] PHP Fatal error:  Call to a member function uri_string() on a non-object in /home/mickm/public_html/_system/libraries/Exceptions.php on line 106
[Sun Oct 12 20:19:23 2008] [error] PHP Fatal error:  Call to a member function uri_string() on a non-object in /home/mickm/public_html/_system/libraries/Exceptions.php on line 106
[Sun Oct 12 20:17:04 2008] [error] PHP Fatal error:  Call to a member function uri_string() on a non-object in /home/mickm/public_html/_system/libraries/Exceptions.php on line 106
[Sun Oct 12 20:16:48 2008] [error] [client 74.6.18.229] Directory index forbidden by rule: /home/mickm/public_html/tamamari/
[Sun Oct 12 19:51:37 2008] [error] PHP Fatal error:  Call to undefined function  form_open_multipart() in /home/mickm/public_html/_application/views/_admin/tutorial/new.php on line 4
[Sun Oct 12 19:48:07 2008] [error] PHP Fatal error:  Call to a member function set_radio() on a non-object in /home/mickm/public_html/_application/views/_admin/tutorial/new.php on line 34
[Sun Oct 12 19:44:52 2008] [error] PHP Fatal error:  Call to a member function set_radio() on a non-object in /home/mickm/public_html/_application/views/_admin/tutorial/new.php on line 34

These all relate (as far as I can tell) to the changed show_404 function. As for the rest, I don't really know where to look... And the site's on shared hosting, so I can't access httpd.conf to look up where the other logs might be.
#26

[eluser]@li[/eluser]
The first few errors about uri_string() look related to the show_404 change, but this error:
Quote:[Sun Oct 12 20:16:48 2008] [error] [client 74.6.18.229] Directory index forbidden by rule: /home/mickm/public_html/tamamari/

looks interesting. Do you see a lot of these errors? If so, it could be possible that accessing index.php is disabled by your apache configurations and that is why you get a lot of these errors. Its also possible that your script throws a lot of errors, and instead of showing them apache throws an internal 500 server error (some servers do this).

Can you try one final thing. Restore the original 404 error then make one more test form submission to get the error again. Then check if there are any new entries in the logs and post here. If not, we can contact your web host about this.
#27

[eluser]@li[/eluser]
Another question.

1) Does this error occur if you put 'curl' in a form field, or does it also occur if you put > 500 characters in the field? If you put in a lot of text but omit curl, does it work?

2) Is your default controller set to index.php? I.e if someone goes to yoursite.com/tutorials/ and your controllers folder is setup as:

application/controllers/tutorials

then will CI look for an index.php to call as the default controller or something else (welcome.php, home.php, etc)
#28

[eluser]Bramme[/eluser]
I got this mail back from the tech support guys from the hosting

"The problem is due to the mod_sec, now it has been disabled to fix the issue."


And I'll be damned, it works.




Theme © iAndrew 2016 - Forum software by © MyBB