Emm... what's the next step?


#1

Hello,

I followed the tutorial in http://wiki.dreamhost.com/Custom_PHP.ini , and I finished at "You can now modify $HOME/x.com/cgi-bin/php.ini to your heart’s content! "

But… What’s the next step? I think I should restart the apache service to make the php.ini work, unfortunately I don’t know how… -_-|

Does anyone know how to make the fresh php.ini work?

Thanks.


#2

[quote]But… What’s the next step? I think I should restart the apache service to make the php.ini work, unfortunately I don’t know how… -_-|

Does anyone know how to make the fresh php.ini work?[/quote]
You don’t need to restart apache, and there is no next step". The preceding step, where you added the handler to an .htaccess file, is what makes your domain use the fresh php.ini.

[quote] Set up the .htaccess file

The .htaccess file is located in your web-root

$HOME/x.com/.htaccess

Add this to run .php files with php cgi

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi[/quote]
If you did everything correctly, you are done! Just check the output of phpinfo(), and you should see you new php.ini and your changed settings.

–rlparker


#3

Thanks! I checked it just now, it really used the new php.ini! amazing!

Do I need to delete the .htaccess after the new php.ini works?

Thanks!


#4

Good deal! You are welcome, and I’m glad it is working for you! :slight_smile:

NO! DO NOT delete that .htaccess file! That file is required in order for your site to continue to use your new php.ini file - PHP is running as CGI on your site and it is that .htaccess file that tells apache what version of PHP and php.ini to use (short explanation). :wink:

–rlparker


#5

I see :smiley:

I thought about another 2 questions just now, if I renew and save the php.ini, will it work immediately, too? Can I add other lines like redirect or something else behind the original 2 lines in the .htaccess?

Thanks!


#6

Yes, if you edit the php.ini, as long as you have that .htaccess in place, the newest php.ini will be loaded each time PHP is run as a CGI process. :wink:

Yes, but make sure that you are careful with the order. If you are running PHP scripts, that handler should be first :wink:

–rlparker


#7

Thanks! Now I am completed understand. :slight_smile: