Page 1 of 1

WP Customization - adding lines in wp-config.php

Posted: Sun Aug 05, 2012 3:13 am
by l.milvio
Greetings,

I'm trying to customize WP installation and I can't add some lines I need to wp-config.php. I need them to be added on a specific point... I suspect my problem is REGEX bound as I'm still trying to get that right! :P

my not-working code snippet is:

Code: Select all

$o->sr("wp-config.php", "#'define\(\'WP\_DEBUG\'\,false\)\;'#", "
define('WP_DEBUG',false); define('WP_CACHE', true);");


thank in advance for your time! :)

Luca

*edited typo*

Re: WP Customization - adding lines in wp-config.php

Posted: Tue Aug 07, 2012 7:14 am
by Phil
Hello,

Please try this:

Code: Select all

$o->sr("wp-config.php", "#define\(.WP_DEBUG.,\s*false\);#", "define('WP_DEBUG',false);define('WP_CACHE', true);");


If issues persist let us know.

Thanks,
Phil

Re: WP Customization - adding lines in wp-config.php

Posted: Tue Aug 07, 2012 7:56 am
by l.milvio
It works perfectly, thanks!! :mrgreen:

I'm flooding you with requests here and using tickets, sorry Phil...

Is there a way to retrieve username and password for the main FTP account during customization?
I'd like to add that info into wp-config.php thanks a lot in advance

Re: WP Customization - adding lines in wp-config.php

Posted: Tue Aug 07, 2012 8:15 am
by Phil
Hello,

I'm afraid the web hosting account's main FTP password isn't something we can retrieve. However, the FTP username is usually the value in the $o->install->owner["user"] variable.

You may be able to use your control panel's API to _create_ a FTP login for the install, however whenever possible we recommend the Suexec model for PHP which bypasses any need for this (SuPHP, etc.).

The number of requests is no problem. If there's anything further we can assist with let us know. :)

Thanks,
Phil