How to configure systemd so that PHP can use memcached unix socket?
up vote
1
down vote
favorite
I'm in the process of upgrading from Ubuntu Server 16.04 to 18.04 and at the same time upgrading from PHP 5.6 to PHP 7.
In /etc/memcached.conf
I added:
-s /tmp/memcached.sock
-a 666
When I restart the service, I see:
srw-rw-rw- 1 memcache memcache 0 Nov 13 03:44 /tmp/systemd-private-7fc3b73707084a93bcc6abd22001eb7e-memcached.service-oIF206/tmp/memcached.sock=
How can I configure systemd to know where the unix socket is?
ubuntu systemd unix-sockets memcached
add a comment |
up vote
1
down vote
favorite
I'm in the process of upgrading from Ubuntu Server 16.04 to 18.04 and at the same time upgrading from PHP 5.6 to PHP 7.
In /etc/memcached.conf
I added:
-s /tmp/memcached.sock
-a 666
When I restart the service, I see:
srw-rw-rw- 1 memcache memcache 0 Nov 13 03:44 /tmp/systemd-private-7fc3b73707084a93bcc6abd22001eb7e-memcached.service-oIF206/tmp/memcached.sock=
How can I configure systemd to know where the unix socket is?
ubuntu systemd unix-sockets memcached
You have made tests right? Most of the sites written for php 5 breaks in php 7
– Rui F Ribeiro
Nov 13 at 5:33
@RuiFRibeiro The sites on my server all use popular packages such as WordPress and MediaWiki. I haven't put any of them on the new server until I can verify everything is working, but I haven't even gotten that far as I discovered this issue with unix sockets for memcached.
– Paul
Nov 13 at 14:01
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm in the process of upgrading from Ubuntu Server 16.04 to 18.04 and at the same time upgrading from PHP 5.6 to PHP 7.
In /etc/memcached.conf
I added:
-s /tmp/memcached.sock
-a 666
When I restart the service, I see:
srw-rw-rw- 1 memcache memcache 0 Nov 13 03:44 /tmp/systemd-private-7fc3b73707084a93bcc6abd22001eb7e-memcached.service-oIF206/tmp/memcached.sock=
How can I configure systemd to know where the unix socket is?
ubuntu systemd unix-sockets memcached
I'm in the process of upgrading from Ubuntu Server 16.04 to 18.04 and at the same time upgrading from PHP 5.6 to PHP 7.
In /etc/memcached.conf
I added:
-s /tmp/memcached.sock
-a 666
When I restart the service, I see:
srw-rw-rw- 1 memcache memcache 0 Nov 13 03:44 /tmp/systemd-private-7fc3b73707084a93bcc6abd22001eb7e-memcached.service-oIF206/tmp/memcached.sock=
How can I configure systemd to know where the unix socket is?
ubuntu systemd unix-sockets memcached
ubuntu systemd unix-sockets memcached
edited 2 days ago
asked Nov 13 at 4:07
Paul
1228
1228
You have made tests right? Most of the sites written for php 5 breaks in php 7
– Rui F Ribeiro
Nov 13 at 5:33
@RuiFRibeiro The sites on my server all use popular packages such as WordPress and MediaWiki. I haven't put any of them on the new server until I can verify everything is working, but I haven't even gotten that far as I discovered this issue with unix sockets for memcached.
– Paul
Nov 13 at 14:01
add a comment |
You have made tests right? Most of the sites written for php 5 breaks in php 7
– Rui F Ribeiro
Nov 13 at 5:33
@RuiFRibeiro The sites on my server all use popular packages such as WordPress and MediaWiki. I haven't put any of them on the new server until I can verify everything is working, but I haven't even gotten that far as I discovered this issue with unix sockets for memcached.
– Paul
Nov 13 at 14:01
You have made tests right? Most of the sites written for php 5 breaks in php 7
– Rui F Ribeiro
Nov 13 at 5:33
You have made tests right? Most of the sites written for php 5 breaks in php 7
– Rui F Ribeiro
Nov 13 at 5:33
@RuiFRibeiro The sites on my server all use popular packages such as WordPress and MediaWiki. I haven't put any of them on the new server until I can verify everything is working, but I haven't even gotten that far as I discovered this issue with unix sockets for memcached.
– Paul
Nov 13 at 14:01
@RuiFRibeiro The sites on my server all use popular packages such as WordPress and MediaWiki. I haven't put any of them on the new server until I can verify everything is working, but I haven't even gotten that far as I discovered this issue with unix sockets for memcached.
– Paul
Nov 13 at 14:01
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
systemd has PrivateTmp=true
for memcached.service
One way would be to override PrivateTmp
, specifically for the memcached.service
, i.e.
mkdir -p /etc/systemd/system/memcached.service.d
echo "[Service]" > /etc/systemd/system/memcached.service.d/override.conf
echo "PrivateTmp=false" >> /etc/systemd/system/memcached.service.d/override.conf
systemctl daemon-reload
systemctl restart memcached
That would change the memcached.service back to using /tmp
, rather than /tmp/systemd-private-...
Assuming you want to use memcached for session handling; Once you've verified that /tmp/memcahced.sock
exists with the correct permissions, in /etc/php.ini
or /etc/php/conf.d/memcached.ini
change session support.
[Session]
extension=memcached.so
session.save_handler="memcached"
session.save_path="/tmp/memcached.sock"
If it exists, comment out session.save_handler=files
.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
systemd has PrivateTmp=true
for memcached.service
One way would be to override PrivateTmp
, specifically for the memcached.service
, i.e.
mkdir -p /etc/systemd/system/memcached.service.d
echo "[Service]" > /etc/systemd/system/memcached.service.d/override.conf
echo "PrivateTmp=false" >> /etc/systemd/system/memcached.service.d/override.conf
systemctl daemon-reload
systemctl restart memcached
That would change the memcached.service back to using /tmp
, rather than /tmp/systemd-private-...
Assuming you want to use memcached for session handling; Once you've verified that /tmp/memcahced.sock
exists with the correct permissions, in /etc/php.ini
or /etc/php/conf.d/memcached.ini
change session support.
[Session]
extension=memcached.so
session.save_handler="memcached"
session.save_path="/tmp/memcached.sock"
If it exists, comment out session.save_handler=files
.
add a comment |
up vote
2
down vote
accepted
systemd has PrivateTmp=true
for memcached.service
One way would be to override PrivateTmp
, specifically for the memcached.service
, i.e.
mkdir -p /etc/systemd/system/memcached.service.d
echo "[Service]" > /etc/systemd/system/memcached.service.d/override.conf
echo "PrivateTmp=false" >> /etc/systemd/system/memcached.service.d/override.conf
systemctl daemon-reload
systemctl restart memcached
That would change the memcached.service back to using /tmp
, rather than /tmp/systemd-private-...
Assuming you want to use memcached for session handling; Once you've verified that /tmp/memcahced.sock
exists with the correct permissions, in /etc/php.ini
or /etc/php/conf.d/memcached.ini
change session support.
[Session]
extension=memcached.so
session.save_handler="memcached"
session.save_path="/tmp/memcached.sock"
If it exists, comment out session.save_handler=files
.
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
systemd has PrivateTmp=true
for memcached.service
One way would be to override PrivateTmp
, specifically for the memcached.service
, i.e.
mkdir -p /etc/systemd/system/memcached.service.d
echo "[Service]" > /etc/systemd/system/memcached.service.d/override.conf
echo "PrivateTmp=false" >> /etc/systemd/system/memcached.service.d/override.conf
systemctl daemon-reload
systemctl restart memcached
That would change the memcached.service back to using /tmp
, rather than /tmp/systemd-private-...
Assuming you want to use memcached for session handling; Once you've verified that /tmp/memcahced.sock
exists with the correct permissions, in /etc/php.ini
or /etc/php/conf.d/memcached.ini
change session support.
[Session]
extension=memcached.so
session.save_handler="memcached"
session.save_path="/tmp/memcached.sock"
If it exists, comment out session.save_handler=files
.
systemd has PrivateTmp=true
for memcached.service
One way would be to override PrivateTmp
, specifically for the memcached.service
, i.e.
mkdir -p /etc/systemd/system/memcached.service.d
echo "[Service]" > /etc/systemd/system/memcached.service.d/override.conf
echo "PrivateTmp=false" >> /etc/systemd/system/memcached.service.d/override.conf
systemctl daemon-reload
systemctl restart memcached
That would change the memcached.service back to using /tmp
, rather than /tmp/systemd-private-...
Assuming you want to use memcached for session handling; Once you've verified that /tmp/memcahced.sock
exists with the correct permissions, in /etc/php.ini
or /etc/php/conf.d/memcached.ini
change session support.
[Session]
extension=memcached.so
session.save_handler="memcached"
session.save_path="/tmp/memcached.sock"
If it exists, comment out session.save_handler=files
.
edited Nov 14 at 14:31
answered Nov 13 at 14:59
Joseph Tingiris
1636
1636
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481372%2fhow-to-configure-systemd-so-that-php-can-use-memcached-unix-socket%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You have made tests right? Most of the sites written for php 5 breaks in php 7
– Rui F Ribeiro
Nov 13 at 5:33
@RuiFRibeiro The sites on my server all use popular packages such as WordPress and MediaWiki. I haven't put any of them on the new server until I can verify everything is working, but I haven't even gotten that far as I discovered this issue with unix sockets for memcached.
– Paul
Nov 13 at 14:01