{"id":272,"date":"2023-01-05T11:50:23","date_gmt":"2023-01-05T07:50:23","guid":{"rendered":"http:\/\/keksus.com\/?p=272"},"modified":"2025-01-05T21:52:50","modified_gmt":"2025-01-05T17:52:50","slug":"change-session-path-in-php-fpm","status":"publish","type":"post","link":"https:\/\/hostatto.com\/blog\/change-session-path-in-php-fpm.html","title":{"rendered":"Change session path in PHP-FPM"},"content":{"rendered":"<p>If you use Linux default sessions in php are stored at<\/p>\n<blockquote><p>\/var\/lib\/php\/sessions\/<\/p><\/blockquote>\n<p>and you want change this settings, create in your server folder <strong>sessions<\/strong> like this<\/p>\n<blockquote><p>\/var\/www\/sessions\/<\/p><\/blockquote>\n<p>Set permissions<\/p>\n<blockquote><p>chown -R www-data:www-data \/var\/www\/sessions<br \/>\nchmod 777 \/var\/www\/sessions<\/p><\/blockquote>\n<p><strong>Note:<\/strong> www-data it`s your nginx user, you can check it in file<\/p>\n<blockquote><p>\/etc\/php5\/fpm\/pool.d\/www.conf<\/p><\/blockquote>\n<p>Now edit <strong>php.ini<\/strong> and set path to your new sessions folder<\/p>\n<blockquote><p>session.save_path = \"\/var\/www\/sessions\/\"<\/p><\/blockquote>\n<p>Restart php-fpm<\/p>\n<blockquote><p>service php5-fpm restart<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>...<\/p>\n","protected":false},"author":1,"featured_media":206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,24],"tags":[33,32,34],"class_list":["post-272","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-php","tag-nginx","tag-php-fpm","tag-sessoins"],"_links":{"self":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/comments?post=272"}],"version-history":[{"count":0,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/posts\/272\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/media\/206"}],"wp:attachment":[{"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/media?parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/categories?post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostatto.com\/blog\/wp-json\/wp\/v2\/tags?post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}