I need help ASAP on magic_quotes_gpc

I have an autoresponder script that has the following in the .htaccess:

php_value magic_quotes_gpc 1

I can’t log into the site and the error log says:

/home/confirming-email/cgi-bin/auto/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration

I need this to run ASAP. Is this a module I need to install? If so how?

Using Debian 4 and VirtualMin Pro 3.48

Thanks.

Mike Murphy

php_value is a mod_php directive–if you aren’t using mod_php this is a nonsensical option.

You need to edit the php.ini for the version of PHP that is running the script, in the etc directory in the home directory of the virtual server in question. (Virtualmin configures PHP to run under mod_fcgid and suexec, so every virtual server gets their own php.ini…and there will be one for each version of PHP that you have installed/enabled.)

OK, I don’t know what any of that means :slight_smile: Is mod_php something I need to install or set up?

The developer said the script was not to be in the cgi-bin, because it is a php script. So I moved it to the public_html folder, but still get the “Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration” error. If I rename the .htaccess so as not to use it, I can get the log in screen, but then it gives an error after that.

I’m going to re-upload and try it again. If I still get error, I’ll get a hold of the developer.

So the developer says I can rename the .htaccess, but he also says:
"And it appears the the curl module is not installed on your server."

Is this a part of Virtualmin or do I need to find it elsewhere?

Thanks.

Mike

OK, I don't know what any of that means :-) Is mod_php something I need to install or set up?

No, it’s one way of running PHP scripts. For security, Virtualmin configures PHP scripts to run under SuExec and mod_fcgid, by default. We strongly discourage use of mod_php in a shared hosting environment. If it’s not a shared hosting environment, switching to mod_php is mostly harmless, but doesn’t provide any benefits.

I'm going to re-upload and try it again. If I still get error, I'll get a hold of the developer.

Why not give a try to the suggestion I made, instead? It’ll actually work, instead of wasting your time repeating the same action expecting different results. :wink:

You can even do it in Virtualmin. I just figured since you have the directive you need (“magic_quotes_gpc”…you don’t want the php_value bit, because that is a mod_php directive, and not a PHP configuration option…it’s a special word for Apache to let it know you want to pass a value on to PHP).

Anyway, select the virtual server that you want to run this script on in the dropdown list in the left menu.

Click "PHP 4 Configuration" or "PHP 5 Configuration" (whichever is the default in this virtual server).

Click PHP Variables

Set the option labeled "Quote all input variables?" to Yes.

Save it.

Now, REMOVE the php_value directive from that .htacces file. It is invalid for an Apache process that does not have mod_php enabled, and you’ve now got it set in the right place (in the php.ini).

So the developer says I can rename the .htaccess, but he also says: "And it appears the the curl module is not installed on your server."

You’d get it from apt-get. It’s probably:

apt-get update
apt-get php4-curl

Or:

apt-get php5-curl

Or, maybe even:

apt-get php-curl

(It depends on which version of PHP you are running this script under, and the package names in Debian–I don’t have a Debian system handy at the moment to know exactly. You could use apt-cache search, to find out what packages are available. Webmin can also install packages via apt-get in the Software Packages module.)

That should, of course, be:

apt-get install php4-curl

Rather than just apt-get php4-curl

Thanks for all the help Joe. I did as you said. The Quote all input variables was set to yes already. I installed curl, and that error disappeared, but not I get:
Fatal error: Call to undefined function mysql_connect() in /home/confirming-email/public_html/ar/includes/library.php on line 0

Do you know what this is?

Mike

I got it. I did a search for the error, and then uncommented out extension=mysql.so in the php5 ini file. I then found and installed php5-mysql, rebooted and it seems to work.

Thanks for all the help Joe. Without people like you, people like me would be totally lost.

Mike