Another individual php config issue.

First off, I’ve read these posts:

http://www.virtualmin.com/forums/help-home-for-newbies/re%3A-per-site-configuration.html
http://www.virtualmin.com/index.php?option=com_fireboard&Itemid=77&func=view&catid=7&id=16875#16875

But I’m still having issues, so let me explain.

  1. I installed the Virtualmin GPL version using install.sh
  2. I created a virtualhost

This virtualhost requires memcache and ioncube. Both are installed, and need an extension line added to the php.ini file.

So, first, I changed the /etc/php.ini file… this was before I knew about virtualmin’s way of having individual php.ini files per user. So of course, this did no good and the site still didn’t work.

Next I tried creating the ~/etc/php5/php.ini file with my needed extensions. No luck.

I tried ~/etc/php.ini no luck

I then went into virtualmin and went to Services -> Configure Website -> PHP and tried adding the extension as PHP Configuration Values. I saw that they were added to the apache httpd.conf file, but they still didn’t load ioncube or memcache. phpinfo confirmed this.

Finally, I found that I could specify for fcgid to use the global /etc/php.ini file by specifying it in the fcgid.conf file as:

DefaultInitEnv PHPRC=/etc

So now, ioncube and memcache loaded and the website appeared to be running correctly, albeit while using the global php.ini file instead of a user specific one. I would have been happy with this if there were no more problems. However, I later installed phpmyadmin in this domains public_html. Installed fine and setup auth as config. Could read the DBs just fine. Then I went to password protect the directory and it continues to fail, no error, just keeps refreshing the page asking for username and password again and again. I’ve created htpasswd and htaccess files dozens of times in the past without issue, so I know I’m doing it correctly and not mistyping anything.

I changed a setting in phpmyadmin to use the cookie authentication mode and an error popped up that made it clear that I had broken suexec rules or something:

PHP Warning: session_start(): open(/var/lib/php/session/sess_ak0ho21cq7jpom0qo3p3b537k7736vfc, O_RDWR) failed: Permission denied (13)

What’s going on? How can I get virtualmin to correctly use a userdir’s php.ini file? Why is http authentication not working?

I could really use some help.

Thanks,

Kurt

I don’t have a GPL install in front of me to look into those issues, but in regards to your phpMyAdmin/session problems – I suspect that’s related to permissions of your session directory.

The "session.save_path" keyword in the php.ini file is where it decides where to put all that – yours appears to be pointing to /var/lib/php/session.

By itself, that’s fine, but you’ll need to make sure that directory exists and is writable (mine is “1666” (ie, chmod 1666 /var/lib/php/session).

Regarding the ~/etc/php.ini stuffs you’re having trouble with, the one question I have is whether that is used for the GPL version, or whether GPL uses the single global /etc/php.ini. I suspect it’s the latter, but I’m not sure off the top of my head.
-Eric

By itself, that's fine, but you'll need to make sure that directory exists and is writable (mine is "1666" (ie, chmod 1666 /var/lib/php/session).

Eric, thanks for your reply. I tried mode 1666 but still didn’t work. Only if I change the mode to 777 will the error go away it seems. However, the http authentication still fails.

Regarding the ~/etc/php.ini stuffs you're having trouble with, the one question I have is whether that is used for the GPL version, or whether GPL uses the single global /etc/php.ini. I suspect it's the latter, but I'm not sure off the top of my head.

I’m beginning to think you’re correct, and that my other issues are strangely unrelated. I removed the line i added to fcgid and sure enough, ioncube and memcache were still part of php. I’m not going to try to figure out why it’s working now and not before.

I’m still baffled as to why http auth isn’t working though.