WordPress.org

Ready to get started?Download WordPress

Forums

Need to edit htaccess to enable PHP 5 (6 posts)

  1. f1f
    Member
    Posted 6 years ago #

    I'm working on a server problem with my host, 1and!, and they've advised I try upgrading to PHP5 to fix the problem. Apparently I can do this as follows:

    By default Apache uses PHP 4 for .php extension. If you don't want to rename all your
    scripts to .php5 you can do the following:
    Create a .htaccess file and place the following line AddType x-mapp-php5 .php in it.

    This will tell Apache to use PHP 5 instead of PHP 4 for the extension .php in the
    directory the .htaccess is placed and all sub-directories under it.

    My concern is I already have WordPress's htaccess file in the same folder as my PHP files. Can I just add this line to the existing htaccess file without breaking it? Will WordPress delete the line when it updates the htaccess file?

    I'm totally lost on this one and badly need help.

  2. cronus3166
    Member
    Posted 5 years ago #

    I know this is old, but you actually sparked an idea and it worked.

    I also have 1and1 and what I did. Is in my root directory I created a folder and put my website in that folder. Instructing the domain name to be re-directed to that folder.

    Then in the main directory I created a new .htaccess file with that command line. Since it makes that directory and everything sub-directory to use the new command line.

    And it works!

  3. krypton1
    Member
    Posted 5 years ago #

    Thanks this fixed a bunch of 500 internal server error's I was seeing on 1and1 with wordpress!!

  4. arapacana
    Member
    Posted 5 years ago #

    f1f:
    you are the RoxkZorz!
    After trying the php.ini with memory=128mb (which didn't work), adding your fix did!
    THANKS!

  5. mejayne1973
    Member
    Posted 5 years ago #

    My fix was simply switching back to php4
    The code suggested for the htaccess file I've found on here doesn't work for me, with php5. I leave the code alone, changed to php4 (cpanel) and wall-ah!

  6. citydevi
    Member
    Posted 5 years ago #

    Thanks Mr. fif. because in my wordpress work hosted in php5.x. so the htaccess is not working on it. I follow up your idea. now it works. I just add "AddType x-mapp-php5 .php" in my htaccess file. now it works. Thanks for your advice.

Topic Closed

This topic has been closed to new replies.

About this Topic