Open_basedir in Virtualmin

Hi I have Virtualmin on Centos with mod_fcgid and try setup open_basedir to work my script.
This my oen_basedir path:
/home/domain/public_html:/home/domain/tmp:/usr/lib/php:/usr/share/pear

This not work

I tested it on other hosting panel with setup open_basedir automatically and my script was working. I don’t want chcange Virtualmin.
Can you help me?

Howdy,

When you say it doesn’t work, what happens exactly? What errors do you see?

And do any errors show up in the logs, in $HOME/logs/error_log?

Thanks!

-Eric

Script use Virtualmin remote api to create accounts. When it is on Virtualmin server result is ‘you already hosting this domain’, ‘this usrname alredy exist’.

When I use it on server with setup open_basedir first time my result was ‘account created’

I haven’t anything in error log

open_basedir isn’t needed on a server running mod_fcgid and can only lead to errors.
However I think your error has to do with something else but it’s not clear to me what you are trying to achieve.
Did you look in other logs to find somekind of error?
If it is because of open_baserdir then there would some permission errors in some log…

It’s my error log. It is something with mod_fcgid?

[Sat Jul 28 11:58:34 2012] [emerg] [client 84.31.19.258] (22)Invalid argument: mod_fcgid: can’t lock process table in pid 12040, referer: http://domain.com/order/

Ok it is mod_fcgid issue https://issues.apache.org/bugzilla/show_bug.cgi?id=48949

So how I can use mod_fastcgi or suphp with Virtualmin? Use mod_php for shared hosting is not secure.

A lot of folks use CGI, and find the performance with it is just fine.

You could try switching to CGI (in Server Configuration -> Website Options), and see if your open_basedir settings work for you.

-Eric

Is it poossible run one domain with cgi and others with fcgid?

Sure!

You can configure that by going into Server Configuration -> Website Options, and changing the PHP Execution Mode.

That setting is per-domain.

-Eric

I create domain with cgi mode and have internal server error

my error log:

Premature end of script headers: php5.cgi

Howdy,

Are there any other errors accompanying that one?

That error just means that the PHP script died unexpectedly – which can happen, but if that’s all there is, that’s going to be hard to track down :slight_smile:

If there’s any errors in addition to that one, that’d really help determining what the issue is.

-Eric

I had some additional directives in vhost for mod_fcgid, delete it and now have this error log

php5.cgi: line 5: [: ne: binary operator expected
PHP Fatal error: Call to a member function config() on a non-object in /home/panel/public_html/includes/class_style.php on line 75

I have made fresh installnVirtualmin on my test server and site run with cgi still loading and loading…
Noting in error log.

So just to clarify – is that with or without enabling the open_basedir setting?

And does it work in FCGID mode?

-Eric

With cgi and enable/diasble open_basedir i have same error

php5.cgi: line 5: [: ne: binary operator expected PHP Fatal error: Call to a member function config() on a non-object in /home/panel/public_html/includes/class_style.php on line 75

With fcgid site work but I have error when creating account

(22)Invalid argument: mod_fcgid: can’t lock process table in pid 12040

Howdy,

Well, the error you’re getting in CGI mode seems to be a PHP issue… if that all had been working before on another system – could you be seeing a PHP compatibility issue?

That is, if it was working on an earlier PHP version previously, and this is a more recent PHP version you’re using now – it’s possible that your application worked with that earlier PHP version, but not this new one.

There’s certainly other possibilities as well – but what you’re seeing is a PHP code error.

The error you’re getting with FCGID – it looks like the PHP script isn’t running at all (perhaps due to the open_basedir setting), so it may not even be getting a chance to try executing the PHP code.

-Eric

I tested it with php from atomic, remi and base repo without any effect. I also try php 5.4 and have same error with cgi.
I don’t know how setup open_basedir correctly.

Script working only with mod_php but it not help me anyway.

Wth mod_fastcgi I have same error like with cgi. My decision is move to suphp. With Virtualmin it is easy :wink: