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.
1,011 questions
0
votes
1
answer
29
views
Why is the audio group missing from www-data under nginx/php-fpm?
TL;DR I am trying to make aplay play a wav file. This requires the current user to be in the audio group. It works fine when I invoke it from a logged in user, even when I su -u www-data but the nginx/...
-1
votes
1
answer
92
views
How to run a PHP Web Server on SteamOS?
I've installed Visual Studio Code and PHP 8.3 from KDE Discover, but now I have no idea how to actually start the PHP Server.
I'm able to do all my PHP Development in VSCode, but no way to actually ...
0
votes
0
answers
48
views
Systemd service to keep a fixed number of the same script running
I have been developing a task based system recently for a PHP project, which consists of tasks stored in a SQL database (MariaDB) for a queue, and a task worker PHP script to go through the queue and ...
0
votes
1
answer
124
views
Getting PID from PHP shell_exec to kill server process later
I'm running a server on Linux, and I need the specific PID so I can kill it later. I'm using PHP with shell_exec to run the server, but how do I get the specific PID of this server?
while($...
1
vote
1
answer
73
views
php rlimit_files appears to not be working
I have my rlimit_files set to 65535 yet when I run lsof -c php-fpm | wc -l I get 218k results.
How is this possible? I never noticed any big issues but I wonder if should increase it?
I even had this ...
0
votes
0
answers
99
views
Sendmail wont work for my ubuntu terminal server (Ubuntu 24.04.2)
I'm currently attempting (and failing) to set up an SMTP mail server on my Ubuntu server so I can recieve emails from the contact page of my php based website. I was planning to send these emails ...
1
vote
0
answers
56
views
Apache force transfer-encoding chunked after update to version 2.4.62
I'm running Apache with PHP-FPM on a RHEL 9 server. After updating Apache from version 2.4.57 to 2.4.62, all HTTP responses now include the Transfer-Encoding: chunked header, even when the PHP script ...
0
votes
0
answers
97
views
What countermeasures are required for alert /var/lib/clamav/rfxn.yara: Php.Exploit.C99-27 FOUND?
Running ClamAV on my Linux Mint laptop gives
/var/lib/clamav/rfxn.yara: Php.Exploit.C99-27 FOUND
What does it mean on a laptop (not a server as such)?
Is the system infected?
-1
votes
2
answers
345
views
PHP-FPM status page returns curl: (56) Recv failure
I have PHP-FPM pool with such configuration blocks:
...
listen = 0.0.0.0:9000
...
pm.status_path = /status
...
I'm getting
curl: (56) Recv failure: Connection reset by peer
while trying
curl 0.0.0.0:...
0
votes
0
answers
49
views
Apache2 PHP error_log() doesn't work when called in some PHP code
On my Linux Ubuntu system I run apache2 web server in the context of a PHP based web application. phpinfo() reports the following
error_log /opt/unetlab/data/Logs/php_errors.txt
I.e. error_log() is ...
0
votes
2
answers
117
views
Troj/PHPShel-CE and PHP/Agent-BJNA trojan
I'm currently dealing with a real threat: the trojans Troj/PHPShel-CE and PHP/Agent-BJNA showed up on my system. I've decided to move to another provider – the first server IP was already blacklisted, ...
0
votes
3
answers
142
views
php code does not execute [closed]
I want to execute a PHP code from VS.code on Debian OS.
I'm sure the Apache is installed and active.
I'm sure the PHP is installed.
I'm sure about the php.executepath is correct.
when I navigate to ...
3
votes
2
answers
154
views
How to preserve newline characters in journald logs from PHP script stdout?
I have some service, which executes php scripts and sends its stdout to journald. Journald splits the log record by newline.
This can be read under lineMax:
journald.conf(5) - systemd | Debian ...
0
votes
0
answers
59
views
On Plesk Obsidian 18 - How to update PHP open_basedir and/or httpd.conf server wide?
We have moved a server over from CentOS (finally) to Alma Linux, part of this move is going from WHM to Plesk. The server hosts around 50 websites.
I have a lot of misgivings about Plesk, but ...
0
votes
1
answer
58
views
nslookup times out when type is set to MX
In order to send 2FA emails from a PHP web site to myself, I set up an MX record override and created a firewall rule that allows access to the mail server for the destination domain, but when I ...
0
votes
0
answers
57
views
php script: shell_exec('nohup /usr/bin/python3 -u /location/script.py > /location/script.log & : Script terminates after 5 seconds but should not
I have a PHP Script with the command
shell_exec('nohup /usr/bin/python3 -u /location/script.py > /location/script.log &');
This PHP Script is called via ajax, the script runs, logfile is ...
0
votes
0
answers
171
views
PHP Rebuild Using Updated OpenSSL
My current setup uses a very old OS (CentOS7.9). I just installed PHP8.2.26 using CWP's PHP Version Switcher module. CentOS yum only updates to OpenSSL to v1.0.2k which is what I had installed. I ...
-1
votes
1
answer
127
views
Upgrade PHP to New Version
My CentOS7 server has a very old version of PHP installed (v7.2.10). I am trying to upgrade to PHP8 but am having some major issues. My server has PHP Version Switcher installed and when I try to have ...
0
votes
1
answer
793
views
Install PHP 5.4 on Ubuntu 22.04 or Debian 12
We have an old PHP application that is used internally within the company. This application has a strict dependency on PHP 5.4 or lower.
Currently, the application is hosted on a virtual machine ...
0
votes
1
answer
120
views
How I can run a php inline script and also provide command line arguments using bash?
I try to make a simple script that pings a network connection:
#!/usr/bin/env bash
# Xdebug ip detector for docker
# Copyright (C) 2023 Dimitrios Desyllas
#
# This program is free software: you can ...
-1
votes
2
answers
984
views
php is still available after running apt-get remove php
I am on Linux Mint and had PHP 8.1 by default but I need to install PHP 8.3.
I removed the existing PHP 8.1 with apt-get remove php.
However, when I run the php command I still see PHP 8.1.
Shouldn't ...
0
votes
1
answer
815
views
install/enable sqlsrv/pdo_sqlsrv php8.1 on AlmaLinux v9.4.0
The hostgator server updated the linux system from CentOs to Almalinux and now I need to install the sqlsrv drivers again as I only get the error could not find driver
What I've done so far is move ...
2
votes
1
answer
352
views
Upgrading PHP versions from buster to bullseye, when I am already on bullseye
I have Debian bullseye
18:14:08 $ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
But it ...
0
votes
1
answer
233
views
PHP memory_limit is not updating for any user, only for root under Debian 12
I have a Debian 12 system, where I use PHP in cli mode. In /etc/php/8.2/cli/php.ini I set the memory limit:
memory_limit = 1024M
If I query it with root, it shows me the right value. But if I use ...
0
votes
1
answer
399
views
AH00141: Could not initialize random number generator
I tried to upgrade my debian system from buster to bullseye and messed up everything. I cant start apache2 and proftpd. When I do apachectl configtest I get the following error message:
(38)Function ...
0
votes
0
answers
423
views
Change log file for php-fpm
In order to have only one .log file related with php issues, I want to force php-fpm to write errors in /var/log/php-fpm/error.log instead of /var/log/php-fpm/www-error.log.
I just updated /etc/php-...
0
votes
0
answers
844
views
OOM invoked regularly by PHP-FPM
I'm using EC2 instance t4g.micro which is arm64, with 1gb ram of the latest ubuntu.
I'm using nginx with PHP-FPM for upload and convert pictures using latest image.intervention with GD.
My PHP_FPM ...
0
votes
0
answers
1k
views
Problem with permissions when supervisor used in php docker image
I am building my app using official php docker image.
Case 1: When I run supervisord with root user and subprocess php-fpm with www-data user. I always get this error log:
FPM initialization failed
...
0
votes
1
answer
118
views
Switch PHP versions in the console, Ubuntu
Trying to switch PHP versions at the shell in Ubuntu:
I'd like to switch from version 8.1 to 8.3. I complete the steps above and restart apache but my server remains using version 8.1?
Am I missing ...
0
votes
1
answer
418
views
Unable to install PHP Modules AlmaLinux
So I'm trying to install the php modules: mysqli, exif, mbstring and dom. But I'm unable to do so...
I have apparently managed to install exif and mbstring with this command, yet it doesn't appear on ...
-4
votes
2
answers
237
views
`curl` not work and does not give any message
I have a script that checks addresses with curl
But why does some of the addresses like the one below hang?
What can I do to avoid it?
Check this address to understand more
curl https://10.10.34.36/...
0
votes
0
answers
498
views
Cant Access Phpmyadmin on Ubuntu LTS 22.04 (HTTP Error Code 500)
I just installed phpmyadmin on my PC. I followed several instructions such as:
sudo apt update
sudo apt install phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www/your_domain/phpmyadmin
I use NGINX ...
-1
votes
2
answers
174
views
How I could check connectivity in shell using an oneliner command without using netcat?
In a docker image I want to avoid installing netcat in order to ping for db connectivity at my entrypoint script:
/bin/sh
MOODLE_DB_HOST="xxxx"
MOODLE_DB_PORT=80
function pingdb {
OK=0
...
0
votes
1
answer
558
views
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....
0
votes
2
answers
185
views
I lose permission every day at midnight
I require a file at the top of my PHP scripts. The file just has connection object for MySQL:
$c->new mysqli('host','usr','pass','db')
The file has 400 permission: -r--------
and I keep it in /etc/...
1
vote
1
answer
567
views
Apache/PHP gets stuck although there are enough resources
The server has a 4C/8T CPU and 32GB RAM. OS: Debian 12. Apache/PHP becomes unresponsive after ~500MB usage. I tried PHP8.2 and PHP8.1, but the result is the same. If I restart PHP, Apache starts ...
0
votes
1
answer
495
views
Force Postfix' /usr/sbin/sendmail to use SMTP
I have written a tool in PHP (on Linux) sendmail mails via mail() (unfortuenately PHPMailer is not an option due do missing support for some required stuff).
PHP ignores all SMTP settings on linux so ...
0
votes
2
answers
2k
views
Install PHP 8.0 Yaml extension on Ubuntu 18.04
I wrote a simple php based on the fisrt example.
https://www.php.net/manual/es/function.yaml-parse.php
I got...
Fatal error: Uncaught Error: Call to undefined function yaml_parse() in /var/www/html/p....
2
votes
1
answer
233
views
apache mpm_prefork limited to 306 connections, yet server limit set to 1000, AH00159 Unable to fork new process
Running Virualmin, still got about 1GB free mem
apache log is full of:
[mpm_prefork:error] [pid 119747] (11)Resource temporarily unavailable: AH00159: fork: Unable to fork new process
<IfModule ...
0
votes
1
answer
1k
views
How to install PHP obtained from remi's repo and created local repository?
Here is my question, I am trying (forced) to install PHP 8.2 into almalinux 8.6, but in a weird way. The idea is to be able to install it without internet, but with some local repositories which ...
0
votes
2
answers
154
views
How netstat is able to read route tables?
For my php containers if I need to detect the ip where ide listens to. I run:
ip=$(netstat -rn | grep "^0.0.0.0 " | cut -d " " -f10)
And I get the gateway IP. But for that I need ...
0
votes
1
answer
98
views
Asterisk pbx agi php script with imagick imaging on the fly not working
Problem description:
Generate an image with an ASTERISK AGI PHP script that is displayed on a phone (Yealnk) using imagick.
installed:php-imagick/oldstable,now 3.4.4+php8.0+3.4.
The AGI PHP script ...
0
votes
0
answers
160
views
SETUID not executing the script as owner when executed via PHP script
I have a sh file (with setuid) that I want specific web users to be able to execute from an endpoint:
-rwsr-xr-x 1 root root 59 Sep 11 09:47 restart-workers.sh
The content of this file is ...
0
votes
0
answers
109
views
After web server move my simple PHP script stopped working
Here is what I'm having trouble with: I've had the below script running for years and it's been fine. But my web host moved / upgraded servers a couple of weeks ago and ever since the script has ...
1
vote
1
answer
446
views
install php 8.1 manjaro
i am trying to install php 8.1 in manjaro but i am getting errors.
This I am doing:
[home_the_archphp_arch]
Server = https://download.opensuse.org/repositories/home:/el:/archphp/Arch/$arch
key=$(curl ...
0
votes
0
answers
40
views
Solution to phpMyAdmin login problem seems unsafe
I had trouble logging into my myPhpAdmin web interface, so after finding numerous posts suggesting I added my un/pw to the config file like this:
$cfg['Servers'][$i]['user'] = 'root'; //mysql username ...
1
vote
1
answer
87
views
How to determine why Apache won't restart?
I just installed a new cert on a RHEL 8 server. I updated the conf files and restarted Apache.
Apache is failing but I can't figure out why. How do I determine what's causing the problem?
Here's what ...
0
votes
0
answers
654
views
RUN apt-get update is not running
FROM php:7.3.33-apache-bullseye
RUN docker-php-ext-install -j$(nproc) mysqli opcache
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install sockets
# Instalar ifconfig
RUN apt-get update &...
4
votes
1
answer
170
views
Can't enable error messages for PHP on my web server
I'm trying to disable error messages for PHP on my Apache2 web server, but it's not working.
I have enabled it in the php.ini file.
error_reporting = E_ALL
I deliberately introduced errors in my test....
3
votes
1
answer
1k
views
How to understand which libapache2-mod-php am I using now?
Listing packages
# apt list libapache2-mod-php*
Listing... Done
libapache2-mod-php5/trusty-updates,trusty-security,now 5.5.9+dfsg-1ubuntu4.29 amd64 [installed,automatic]
libapache2-mod-php5.6/now 5.6....