Page 1 of 1

VestaCP php-mysql issues

Posted: Sat Dec 28, 2013 9:13 pm
by KeiroD
So... for a very brief time I had MySQL + PHP working fine. At least, up until I started working on fixing the SSL portion. I was able to get it to 500... and as I started to work on that, and worked on fixing the permissions... I run smack dab into this:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

So, charmedtouches.com/test.php reveals that PHP is pulling its extensions from

Code: Select all

/usr/local/vesta/php/lib/php/extensions/no-debug-non-zts-20100525
But for some reason after the OS upgrade from 13.04 to 13.10... the directory no longer existed, so I recreated it and tried to copy the mysql.so from /usr/lib/php5/20121212.

However... that does not work as one would expect and results in this error:

[28-Dec-2013 12:57:51] NOTICE: PHP message: PHP Warning: PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0

when service vesta is restarted. How would one fix this specific issue so VestaCP works? Or... well, for that matter, to get PHP/Apache2 working properly once more?

... I must admit, I didn't think I'd encounter so much of an issue from upgrading apache2.2 to apache2.4.

Re: VestaCP php-mysql issues

Posted: Sun Dec 29, 2013 9:23 am
by grainga
Does Vesta officially support 13.10?

By the way, how did you get FPM? I'm using CGI/FastCGI with APC. Thanks.

Re: VestaCP php-mysql issues

Posted: Sun Dec 29, 2013 9:33 am
by KeiroD
grainga wrote:Does Vesta officially support 13.10?

By the way, how did you get FPM? I'm using CGI/FastCGI with APC. Thanks.
apt-get install php5-fpm. Reconfigure VestaCP's php5-fpm configuration to work with Ubuntu's php5-fpm configuration, instead.

Presto, you have a working php5-fpm install.

Edit: And as far as Vesta officially supporting 13.10... not quite, I think.

However, the VestaCP admin CP do seem to continue functioning just fine with 13.10... it's just the Apache 2.2 to 2.4 changes that kinda threw the user front-end website into a borkenated setup.

Edit2: VestaCP admin backend correctly detects 13.10.

Edit3: Why, oh why do you guys consistently use your own extensions and stuff? This would be so much easier if you just use default stuff for the respective package management systems.

I do not think we will be commercially using VestaCP.

Re: VestaCP php-mysql issues

Posted: Sun Dec 29, 2013 6:17 pm
by grainga
KeiroD wrote:
grainga wrote: apt-get install php5-fpm. Reconfigure VestaCP's php5-fpm configuration to work with Ubuntu's php5-fpm configuration, instead..
Cool, installed fpm. Did you have to edit the apache/nignx templates to actually use fpm on the sites? phpinfo still showing CGI/FastCGI.

Yes, it's a bit confusing the way it's built. It's especially not clear to me nginx vs vesta-nginx.

Re: VestaCP php-mysql issues

Posted: Sun Dec 29, 2013 6:58 pm
by KeiroD
grainga wrote:
KeiroD wrote:
grainga wrote: apt-get install php5-fpm. Reconfigure VestaCP's php5-fpm configuration to work with Ubuntu's php5-fpm configuration, instead..
Cool, installed fpm. Did you have to edit the apache/nignx templates to actually use fpm on the sites? phpinfo still showing CGI/FastCGI.

Yes, it's a bit confusing the way it's built. It's especially not clear to me nginx vs vesta-nginx.
Yes. Um... let me provide a sample.

USER CONFIGURATION: /home/username/conf/web/php-fpm.conf

Code: Select all

[user]
listen = /var/run/user-fpm.sock
listen.owner = user
listen.group = user
user = user
group = user
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 35
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500
listen.backlog = -1
pm.status_path = /status
request_terminate_timeout = 120s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes
env[HOSTNAME] = $HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
php_admin_value[date.timezone] = America/Los_Angeles
SERVER-WIDE PHP5-FPM CONFIG LOCATION: root@server:/usr/local/vesta/php/etc#

Code: Select all

;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;

; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr/local/vesta/php). This prefix can be dynamicaly changed by using the
; '-p' argument from the command line.

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
;  - the global prefix if it's been set (-p arguement)
;  - /usr/local/vesta/php otherwise
;include=etc/fpm.d/*.conf
include=/home/user/conf/web/php-fpm.conf
This is the important bit that you want to enable for each user. You can edit the global server configuration to use php5-fpm globally instead of using VestaCP's special config.

Re: VestaCP php-mysql issues

Posted: Sun Dec 29, 2013 8:41 pm
by grainga
It's interesting, occasionally when I switch from fcgid to default mod_php it doesn't actually change. I've tested this in a phpinfo file. Will try this solution now. So I need to enable php fpm manually for each domain?

Edit: Looks like there's a bug when changing the apache templates and while having an SSL cert installed on that domain. This specific sapache2.conf file literally has dozens of virtual hosts inside.

Re: VestaCP php-mysql issues

Posted: Sun Dec 29, 2013 9:42 pm
by KeiroD
grainga wrote:It's interesting, occasionally when I switch from fcgid to default mod_php it doesn't actually change. I've tested this in a phpinfo file. Will try this solution now. So I need to enable php fpm manually for each domain?

Edit: Looks like there's a bug when changing the apache templates and while having an SSL cert installed on that domain. This specific sapache2.conf file literally has dozens of virtual hosts inside.
Ouch. I have a more or less working setup... save for that damn PHP API issue.