Questions tagged [php]

PHP is a widely-used, general-purpose scripting language that is especially suited for web development. Use this tag when you are dealing with a PHP script, installing PHP, or configuring a PHP installation.

Adapted from Wikipedia

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP code may be embedded into HTML code, or it can be used in combination with various web template systems, web content management system and web frameworks. PHP code is usually processed by a PHP interpreter implemented as a module in the web server or as a Common Gateway Interface (CGI) executable. The web server combines the results of the interpreted and executed PHP code, which may be any type of data, including images, with the generated web page. PHP code may also be executed with a command-line interface (CLI) and can be used to implement standalone graphical applications.

PHP's official website is: http://php.net/.

995 questions
60
votes
8 answers

Is there any command to enable/disable a php extension from command line?

Is there any command to enable/disable a php extension easily from command line? (php.ini)
Real Dreams
  • 2,365
6
votes
3 answers

How to get phpize for a certain PHP version?

If I run phpize -v then I get Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718 If I open phpinfo then it shows a newer date so my phpize is outdated. This is the output of php…
Black
  • 2,079
4
votes
2 answers

What do the dates at /usr/lib/php/ represent?

On a Debian system, PHP extension binaries reside in /usr/lib/php/. Inside are folders for each PHP version, like 7.2 and 7.3, as well as folders named after dates, like 20170718 and 20180731. Installing extensions using pecl install does not always…
4
votes
2 answers

shell_exec cannot create file

I'm using nginx webserver and I'm writing a script that includes file creation but www-data is not able to create the file even I give permission in the sudoers list. Inside my sudoers file: www-data ALL=(ALL) NOPASSWD: /usr/bin/php,…
Mboy
  • 49
2
votes
1 answer

How to install PHP 7.3 on MXLinux 18?

I want to learn PHP 7.2 or 7.3 on my newly installed MXLinux 18. But After installing the lamp stack by using MX Package Manager, php version is reported to be just PHP 7.0. I would like to know if there is any way to upgrade to or install PHP…
Tower
  • 479
2
votes
1 answer

Which PHP ini file

When I execute the bash command php --ini to find the location of the php.ini file, the loaded one is: Loaded Configuration File: /etc/php5/cli/php.ini But when I run a php.info on my webserver, I get this as the loaded…
2
votes
0 answers

CodeIgniter On LAMP not loading database library

I have installed LAMP TURNKEY Debianf Wheezy I unzipped codeigniter into /var/www/ It worked fine. But If I autoload or load any controller that uses library database it throws a 500 error. The database credentials are working fine. Checked with…
1
vote
2 answers

How to install PHP 5.3 on RHEL5

I'm working with a RHEL5.1 box that has PHP 5.1.6 installed by default. I need to upgrade PHP to PHP 5.3.x.
1
vote
1 answer

php not working (source file)

I do not know why php is not working. I install Nginx and php server { listen 80; server_name t.com t.com; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; root /var/www/t.com/public_html/; index …
1
vote
1 answer

php - running shell command using shell_exec

I'm using an ajax call to execute "shell_exec" on the server (centos). The line that I'm executing is the following echo shell_exec("php -q /websockets/timedactions.php"); This is the server response: X-Powered-By:…
lior r
  • 121
0
votes
0 answers

Problem installing ext-sodium * for installing lcobucci/jwt 4.3.0 and kreait/firebase-tokens 4.3.0 for laravel project

createtoken(""); is not working in my laravel project... where I have deleted vendor file and done composer install : I am getting : Problem 1 lcobucci/jwt is locked to version 4.3.0 and an update of this package was not requested. lcobucci/jwt…
0
votes
1 answer

Code coverage in pest (build on phpunit) failing. Missing xdebug with laravel unit testing

I try to run php artisan test --coverage (laravel unit testing) but i get 2 errors WARN No filter is configured, code coverage will not be processed and 2 WARN Unable to get coverage using Xdebug. Did you set Xdebug's coverage mode? I dont get…
Ivar
  • 1
0
votes
1 answer

Broken PHP Update

I am on Ubuntu server 20.04, running LAMP with php7.4-fpm. I just performed the latest update/upgrade and confirmed everything was working correctly: ● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager Loaded: loaded…
0
votes
1 answer

Upgrade PHP from 7.2 to 7.4

So, I'm on my local machine (Ubuntu 20.04) with multiple versions of PHP installed. I'm attempting to switch between 7.2 and 7.4. Here's my approach:- $ sudo update-alternatives --config php There are 3 choices for the alternative php (providing…
cookie
  • 222
  • 3
  • 8
  • 20
0
votes
0 answers

Restart php-fpm in "d" state using systemd

I have a php-fpm pool serving files from network attached file systems, so sometimes I see messages like this in my dmesg logs: [Sat Jul 10 01:51:56 2021] INFO: task php-fpm:2260874 blocked for more than 1208 seconds. [Sat Jul 10 01:51:56 2021] …
Freedo
  • 1,255
1
2