I have tried this on my computer with Bitnami WAMP and in remote server (Arvixe). Because it does not work on the remote server, maybe the reason is in .htaccess? Where else could be the reason that REQUEST['url'] is not working?
C:\Bitnami\wampstack-5.6.20-0\apache2\htdocs\www\Plan2own\public\index.php
Expand|Select|Wrap|Line Numbers
- <?php
- error_reporting(E_ALL);
- //phpinfo();
- echo'<br> index.php _GET = **', var_dump( $_GET ), '**';
- echo'<br> index.php _POST = **', var_dump( $_POST ), '**';
- echo'<br> index.php GLOBALS[_REQUEST] = **', var_dump($GLOBALS['_REQUEST']) , '**';
- echo'<br> index.php _REQUEST = **', var_dump( $_REQUEST ), '**';
- echo'<br> index.php _REQUEST[url] = **', var_dump( $_REQUEST['url'] ), '**';
- echo'<br> index.php _GET[url] = **', var_dump( $_GET['url'] ), '**';
- echo'<br> index.php _POST[url] = **', var_dump( $_POST['url'] ), '**';
Expand|Select|Wrap|Line Numbers
- Options -MultiViews
- Options -Indexes
- RewriteEngine on
- RewriteBase C:\Bitnami\wampstack-5.6.20-0/apache2/htdocs/www/Plan2own/public
- RewriteCond %{ENV:REDIRECT_STATUS} ^$
- RewriteCond %{ENV:REQUEST_FILENAME} !-d
- RewriteCond %{ENV:REQUEST_FILENAME} !-f
- RewriteCond %{ENV:REQUEST_FILENAME} !-l
- RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
index.php _GET = **array(0) { } **
index.php _POST = **array(0) { } **
index.php GLOBALS[_REQUEST] = **array(0) { } **
index.php _REQUEST = **array(0) { } **
index.php _REQUEST[url] = **NULL **
index.php _GET[url] = **NULL **
index.php _POST[url] = **NULL **
For example, using url http://plan2own/index.php?a=b i am getting empty url.
index.php _GET = **array(1) { ["a"]=> string(1) "b" } **
index.php _POST = **array(0) { } **
index.php GLOBALS[_REQUEST] = **array(1) { ["a"]=> string(1) "b" } **
index.php _REQUEST = **array(1) { ["a"]=> string(1) "b" } **
index.php _REQUEST[url] = **NULL **
index.php _GET[url] = **NULL **
index.php _POST[url] = **NULL **
The idea is that i should get home from http://plan2own/index.php/home , i.e. i should get controller and methods.
I read `http://stackoverflow.com/questions/5701588/why-is-request-empty` (a) commenting out auto_globals_jit in php.ini and restarting apache did not help; (b) request_oder and variable_order in php.ini are correct in my case.
I am checking the correct php.ini file, which i can see using phpinfor(); in "Loaded Configuration File" line.