emm... what's the next step?

emm... what's the next step?

Posted by: yusun
Posted on: 2008-03-22 01:30:00

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.

Re: emm... what's the next step?

Posted by: rlparker
Posted on: 2008-03-22 03:24:00

In reply to:

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?


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.

In reply to:

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


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

Re: emm... what's the next step?

Posted by: yusun
Posted on: 2008-03-22 03:42:00

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!

Re: emm... what's the next step?

Posted by: rlparker
Posted on: 2008-03-22 03:49:00

In reply to:

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


Good deal! You are welcome, and I'm glad it is working for you! smile

In reply to:

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


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

Re: emm... what's the next step?

Posted by: yusun
Posted on: 2008-03-22 04:05:00

I see :D

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!

Re: emm... what's the next step?

Posted by: rlparker
Posted on: 2008-03-22 04:13:00

In reply to:

if I renew and save the php.ini, will it work immediately, too?


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

In reply to:

Can I add other lines like redirect or something else behind the original 2 lines in the .htaccess?


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

--rlparker

Re: emm... what's the next step?

Posted by: yusun
Posted on: 2008-03-22 04:16:00

Thanks! Now I am completed understand. :)

Tags: work thanksiniwikiapacheheart