Welcome Guest, Not a member yet? Register   Sign In
dreamhost and URI
#1

[eluser]giorg[/eluser]
Hi all,

first timer here ;-)

On my local machine I have my CI app working fine.
When I put my files in production (dreamhost) start the problems: at the beginning there was the "non input specified" alternate with the 404 error; reading a bit on the net I set my .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]
</IfModule>

and in the config I have now

$config['uri_protocol'] = "AUTO";

(before was PATH_INFO). Now I can see my login page at http://myhost/login/index as expected, but after logged in at http://myhost/oggetti/index?item=concorso I get

The URI you submitted has disallowed characters: index&item=concorso

I've read if I enable query_string then the uri helper could not work as expected, and that would mean rewrite my whole application (undesiderable).
Any suggestion?

Thx a lot

Andrea
#2

[eluser]Scott Severance[/eluser]
You can try setting $config['permitted_uri_chars'], but it really appears that you're trying to use CI to do something that it wasn't designed to do. Query string-free URIs is one of the central features of CI.

You might be able to change your links to use clean URIs without rewriting your app. What if you did something like this from the command line:
Code:
cd system/application
grep -Ern 'anchor(.*\?.*)' * | less
This would give you a list of the files and lines that need to be changed so you wouldn't have to hunt through your entire app. Of course, you might need to adjust the regex to match your coding style. If you did it right, you might even be able to use sed to make the changes for you.
#3

[eluser]giorg[/eluser]
Hey Scott,

thx a lot for your answer. Actually I just would like to have my app working as in my local machine: with PATH_INFO. I don't understand why on dreamhost this could not be possible...
#4

[eluser]Scott Severance[/eluser]
[quote author="giorg" date="1184585875"]Hey Scott,

thx a lot for your answer. Actually I just would like to have my app working as in my local machine: with PATH_INFO. I don't understand why on dreamhost this could not be possible...[/quote]

It probably has something to do with a difference in either PHP or Apache settings. Create a PHP file on both your local machine and your webhost that contains simply
Code:
&lt;?php php_info() ?&gt;
Look for differences in the settings. If that isn't fruitful, try to replicate your local Apache setup on your webhost (e.g., by setting stuff in your .htaccess).

Another possible difference might be in versions. Not much you can do about it if dreamhost is using an outdated version of Apache or PHP. Fortunately, the PHP folks have finally decided to end support for PHP 4, a decision that's several years overdue.
#5

[eluser]giorg[/eluser]
Hi again Scott,

would be very easier if some CI guru could tell us exactly which PHP conf option to set, or which apache conf...
Like this it will take ages...

Thank you anyway!!
#6

[eluser]giorg[/eluser]
I did a little comparing the two phpinfo result: on my local machine, *where everything is working fine*, THERE IS NO PATH_INFO variables; on dreamhost, there are 3 variables named PATH_INFO (2 under PHP environment, 1 under Apache Environment), and they all have the same value, which is the path of the current script (p.php -the one with phpinfo()- in my case).

PHP versions: 4.4.5 and 4.4.7 (don't think that is the problem).
Apache versions: 2.2.4 and 2.0.54 (could this be the problem ?!?!?).

Thx
Andrea
#7

[eluser]Luci3n[/eluser]
CI will only work on Dreamhost with PHP 5, enable this from panel.dreamhost.com and your app will work ok, for further intrustions look under hosting in the wiki or search for dreamhost in the forums.

Hope this helps
#8

[eluser]giorg[/eluser]
Hi,

thanks a lot for your suggestion. Unfortunately one of the requirements from the customer was to use PHP 4, so I cannot switch to 5.




Theme © iAndrew 2016 - Forum software by © MyBB