Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
mod_php PHP error in HTACCESS fuelphp
  • Hi I have problem when I want publish my web application into my domain, the problem is I got error 500 server Internal Error, when I am try to access url of my application.

    I think the problem is inside .htaccess

    <IfModule !mod_fcgid.c>

    # for normal Apache installations
    <IfModule mod_php5.c>
    RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>

    # for Apache FGCI installations
    <IfModule !mod_php5.c>
    RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
    </IfModule>

    </IfModule>

    my web apache not loaded mod_php5 , it's possible to still run ?

    and can you explain to me, why using mod_php5 ? 

    when I am try to var_dump(php_sapi_name()) the result is 
    string(8) "cgi-fcgi"
  • Are you sure your hoster runs apache? And not for example nginx or another webserver with fastcgi?

    If you explicitly request index.php (http://yourdomain/index.php) it should not use any rewriting rules, as it will have a direct hit on a file. If that doesn't work either, your problem is elsewhere.
  • Hi Harton

    Yes I am sure, i have check on phpinfo  then 

    SERVER_SOFTWAREApache

    for  accessing domain.com is work , but when accessing with path of uri example domain.com/about-us it's show me 500 internal server error.
  • On which Fuel version are you?

    And are you sure you have the latest .htaccess file? See https://github.com/fuel/fuel/tree/1.8/develop/public

    FastCGI on Apache is nothing special, it's been supported for quite some time.
  • my fuelphp version is 1.6
    I am use that ht access my index page is error 500 internal server error , before is not.

    it's possible because we don't load mod_php ?
  • I am update with that but still get error.

    actually this is problem in shared hosting, in my vps server is not have problem, but I don't know why in shared hosting is problem, it's because not have module like in my vps server ?


  • Did You have some list requiretment for fuelphp installed on shared hosting ? so I can tell my web hosting to active that or chang eweb hosting if the can't.
  • That looks like a crap hoster. Very old PHP version, multibyte support disabled (so any utf-8 will fail).

    It might be an antique installation that still rewrites to fcgi? In that case, you may have to add:

    RewriteCond %{REQUEST_URI} ^/cgi-bin/php5.fcgi(.*)

    Before the rewrite.

    Doesn't this hoster provide support? If they have done something special, I'm sure you're not the first one to bump into this? Most apps these days require rewriting...
  • Yeah,Someday I am place my code into another hosting it's work, but in this case is make me headache.

    I tell hoster provide and he just answer to upgrade package of hosting.
    so in this web hosting didn't support URL Rewriting ? what is the impact ? 
    and what should I do for run this web application in that web hosting ?



  • I am update my htaccess like your suggestion : 
    first I am still get error 500 server insternal error
    RewriteCond %{REQUEST_URI} ^/cgi-bin/php5.fcgi(.*)
    <IfModule mod_rewrite.c>
     ...........
    </IfModule>

    second I am place inside mod_rewrite it's same error
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_URI}^/cgi-bin/php5.fcgi(.*)
     ...........
    </IfModule>
  • No, you need to place that just before the fcgi RewriteRule, otherwise it doesn't work.

    Since it's a shared host, you don't have access to the rewrite log either I suppose? With the time you have spend on it sofar, you probably could have bought a better hosting package. ;-)
  • Hi harton


    Can you tell me what the requiretment for run all of function fuelphp framework like oil,url rewriting, ect.

    So I can give them reason about why my web apps cannot run in their web hosting like extension, module, addons, or somethin to run fuelphp.

    Maybe this ia can help for another people that have same problem.
  • There aren't that many requirements, the few that are there are also listed in the docs:
    - minimum PHP 5.3.3
    - finfo pecl extension installed (must be default in 5.3, but some hosters doen't)
    - rewrite is only needed if you want to remove "index.php" from the URL

    I haven't seen an installation that doesn't run Fuel, and I've used Apache (on Linux, MacOS and Windows), Linux both with FastCGI (on Debian) and mod_php5 (on CentOS), Nginx with fastCGI on Linux, and IIS on Windows.

    In all cases, Fuel ran out of the box with either the included htaccess or the IIS webconfig. For Nginx, see http://fuelphp.com/forums/discussion/comment/15105#Comment_15105 for a working config.

    For me it is currently unclear what the exact setup of your hoster is, but Fuel's rewriting rules are extremely simple, so the hoster should be able to assist in producing a working rule?
  • Hi harton

    you said multibyte support disabled (so any utf-8 will fail).
    what is this mean ? because in my site any some code show , but i don't where come from , I am sure I don't var_dump or debug some code, but showing this, that is about multibyte support ?

    X-Content-Type-Options
    Set-Cookie: cid=hJ9gb-hhDBu3tCV1rFlToKwUcZt9WszuCaVH1fA9SbQrxLzTM-IY9dvkakJeyHBI3EnAP57_W8KoDS6vKPggLHl1cjk4cC1nMGszMkxNU0UxcXZja2REVWw5elVabThJMlhZQzVOT3Z5Um8; path=/
    Content-type: text/html


  • No, multibyte is a character set like utf8 (but there are plenty of others) where characters are represented by two bytes. Compared to ASCII, where one byte is used. You need a characterset like this to be able to work with non-western languages, from Russian to Chinese, Japanese or Thai.

    Everything on the web these days defaults to utf8.
  • Hi harton,

    It's sick, my client still keep old web hosting, he want I am change my code to support with that web hosting.

    did you know it's possible to use url rewrite eith php.info like that ?
  • Without knowing what the exact setup is, it is impossible to find a solution.

    I would contact the hoster, and ask them. They have designed their web hosting platform, so they should be able to tell you rewriting is done on that platform, it's very common functionality.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion