You have a folder public on the server /var/www/site.com/public/ And want to check its permissions without accessing the terminal, using PHP. To do this, run the following command. $folder = '/var/www/site.com/public/'; echo 'Permissions: ' . substr(sprintf('%o', fileperms($folder)), -3); echo 'Owner: ' . posix_getpwuid(fileowner($folder))['name']; echo 'Group: ' . posix_getgrgid(filegroup($folder))['name']; The result...
PHP
strtotime function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC) Let's write the current date in the Unix timestamp format: echo strtotime("now"); This is how you can add three days to the current time echo strtotime("+3 day") Converting the Unix timestamp to the current date and time echo...
Install PHP 8.3 on Debian 12 apt update && apt install -y wget gnupg2 lsb-release wget https://packages.sury.org/php/apt.gpg && apt-key add apt.gpg echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list apt install -y php8.3 After installation check php version php -v Install PHP-FPM and Extensions If you also want to install additional modules, then first...
To install php7.1 you don't need to delete php5. PHP 7.1 will be installed in a separate folder /etc/php/7.1/ First add Dotdeb PPA and import the GPG key of Dotdeb repository apt-get install apt-transport-https lsb-release ca-certificates wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg Then add PPA in your server and update echo 'deb https://packages.sury.org/php/ jessie main' > /etc/apt/sources.list.d/php.list apt-get...
If you use Linux default sessions in php are stored at /var/lib/php/sessions/ and you want change this settings, create in your server folder sessions like this /var/www/sessions/ Set permissions chown -R www-data:www-data /var/www/sessions chmod 777 /var/www/sessions Note: www-data it`s your nginx user, you can check it in file /etc/php5/fpm/pool.d/www.conf Now edit php.ini and set path to your new sessions folder session.save_path...