Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
16 views

How to install a specific php version on ubuntu

I'm trying to install an older version of PHP 8.0 in my ubuntu the version is 8.0.14 I tried several ways ... sudo add-apt-repository --yes ppa:ondrej/php sudo apt install php8.0.14 I get this error ...
user avatar
1 vote
1 answer
20 views

Automatically restart linux on hung task timeout dmesg

I think I have a issue related to random networking issues, that affect and make my php processes to get stuck in D state. This prints a kernel error: [Tue May 17 11:24:55 2022] INFO: task php-fpm:...
user avatar
  • 1,035
0 votes
0 answers
25 views

PHP Extensions Are Not Enabled

I am running RHEL 7 and I am trying to use PHP 8.1. PHP is installing and the extensions are installed (per-Yum) but not enabled per-PHP. For example, if I run php -m | grep dom from the command line ...
user avatar
  • 101
0 votes
1 answer
23 views

Run root script from www-data user

I have a problem to run a command that requires root privileges via php on the apache server I added a command to sudoers so that it does not require a password for the user visudo: # # This file ...
user avatar
1 vote
1 answer
15 views

An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

The following command results in the above error; symfony console doctrine:migrations:execute --up 'DoctrineMigrations\Version20220513151605' Lot's of questions on it but I cant find any that match ...
user avatar
  • 182
0 votes
0 answers
19 views

What is the safe way to adding an FTP user through PHP? [migrated]

There is a form on the website with "FTP username" and "FTP password" for administrators. How to safely add the FTP user by PHP? Because currently we are connecting to the server ...
user avatar
  • 1
0 votes
1 answer
24 views

WordPress site broke when updating to php 8.0

I am hosting a WordPress website on Debian 10. I just installed php8.0. When I a2enmod php8.0, the WordPress site breaks entirely. On Firefox I get the following message: Secure Connection Failed An ...
user avatar
  • 11
0 votes
0 answers
25 views

Struggling with du, php and crontab

Unix numpty here. I have written a PHP script which I am running from a crontab every so often. Part of the script is a du command from which I extract certain directory sizes which I put into a JSON ...
user avatar
0 votes
0 answers
80 views

How to install php 8 to aarch64 oracle linux?

Since official Oracle Linux only support up to 7.4 and Remi repo also doesn't support aarch64 , how to install PHP 8 to aarch64 oracle Linux?
user avatar
0 votes
1 answer
37 views

analyse webserver execution time

I have 2 VMs which are almost the same, except for hostname and things that shouldn't matter (as far as I know). On these VMs I run nginx/1.14.2 as proxy with an Apache/2.4.38 webserver behind it ...
user avatar
1 vote
1 answer
73 views

PPA not listing all available php packages

I have added the corresponding PPA: sudo add-apt-repository ppa:ondrej/php I have run sudo apt update But it's only showing candidates for php7.4 sudo apt install -y php8.0 produces E: Couldn't find ...
user avatar
  • 113
0 votes
1 answer
119 views

Remi PHP5/PHP7 repository yum update error

When I run: yum update I get the error: Error: Package: php-pecl-zip-1.20.0-1.el7.remi.5.6.x86_64 (remi-php56) Requires: php(api) = 20131106-64 Installed: php-common-7.4.0~RC1-1....
user avatar
  • 101
0 votes
1 answer
16 views

Saving files to another partition with PHP or Symbolic Link?

We have a PHP based application running on a cPanel server which saves tons of API log files (millions), and we are looking to have the PHP scripts be able to write the API log text files into another ...
user avatar
1 vote
0 answers
190 views

nc -lvnp (port) Non-responsive w/ PHP Reverse Shell til closed

I am currently working on Machine's on HackTheBox. I've used nc -lvnp (port) quite a bit and i've never ran into this issue: $nc -lvnp 4444 listening on [any] 4444 .... connect to [my IP] from (...
user avatar
0 votes
0 answers
68 views

What is eating up my CPU?

I am facing a difficult situation. 100% CPU but I cannot see a singular process using much in top or htop. I run this command: :~$ ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 %CPU PID USER ...
user avatar
  • 407
0 votes
0 answers
40 views

Why shell_exec returns different response than bash terminal?

I'm running this code in php: shell_exec("cat /proc/mounts | grep \"^/dev\" | grep -v loop"); and it returns /dev/sda5 / ext4 rw,relatime,errors=remount-ro 0 0 /dev/sda1 /boot/efi ...
user avatar
0 votes
1 answer
197 views

schedule cron job for every hour is not working

I am running a single instance cron job for certain task. My script looks like below: # every hour interval 0 * * * * php /project/yii daily/order # every 30 minutes interval */30 * * * * php /...
user avatar
0 votes
1 answer
123 views

unmet dependencies: php-memcached : Depends: phpapi-20190902

I'm trying to install php-memcached (with php8.1) but have the following error: # apt install php-memcached Reading package lists... Done Building dependency tree... Done Reading state information... ...
user avatar
-1 votes
5 answers
84 views

Reducing HDD seek time in reading the contents of many files in bash [closed]

I read millions of files in subdirectories of /XX/XX/XX/ to process the content of each file. In PHP, I read the files as foreach(glob("/folder/*") as $a){ foreach(glob("$a/*") ...
user avatar
  • 1,663
0 votes
1 answer
38 views

How to use Available Package instead of Installed Package when Yum spits out a required error

First and foremost, I blindly followed a tutorial to upgrade from PHP 7.3 to PHP 7.4, which called for yum remove "php*" -y Of course this just screwed up everything. It removed two very ...
user avatar
0 votes
0 answers
55 views

LAMP server not executing PHP hello world

My goal is to set up a LAMP server to execute a PHP file. It must execute in PHP 5; the legacy project I'm working with won't work in PHP 7+. I followed the online tutorials to get my Apache server ...
user avatar
2 votes
2 answers
1k views

sh: which: line 1: syntax error: unexpected end of file; sh: error importing function definition for `which'

We are running: Red Hat Enterprise Linux release 8.5 (Ootpa). We allow the server to update weekly using "yum -y update". We recently began receiving the following errors when executing ...
user avatar
  • 161
0 votes
0 answers
83 views

Activating php-fpm on apache2 Ubuntu 20

I've recently installed FPM on our server but for some reason cant get it to activate on the server API. When I check the status of php7.4-fpm it is active and running. I followed the notice ...
user avatar
  • 103
1 vote
4 answers
104 views

Parallel execution of remote commands

The setup: I have a PHP script (currently written for PHP5.5, but the server it runs from has 7.4) that processes files that contain lists of linux servers, then runs a bash or perl script via ssh on ...
user avatar
  • 131
0 votes
1 answer
44 views

Install new version of C-ares on Centos 7

I'm trying to install a more recent version of c-ares on a Centos 7 server. The repo only has 1.10. Any ideas other than upgrading to Centos 8 to get c-ares 1.13 ?
user avatar
  • 103
0 votes
1 answer
54 views

Not parsing all ini files in /etc/php.d

Oracle Linux Server release 8.5 Apache/2.4.37 (Oracle Linux) PHP 7.2.24 The specific INI file is 20-oci8.ini, using php -i in the command line, it shows that the INI file was parsed and an OCI8 ...
user avatar
0 votes
0 answers
274 views

Updating PHP packages: Module 'zip' already loaded in Unknown on line 0

My latest yum update yielded some interesting output: Updating : php-pecl-zip-1.20.0-1.el7.remi.7.4.x86_64 71/241 PHP Warning: Module 'zip' already loaded ...
user avatar
  • 355
0 votes
0 answers
35 views

dnf install php-zip conflicting requests

i'm try install php-zip in fedora 34 He tells me there is a conflict: Problem: conflicting requests - nothing provides libzip(x86-64) >= 1.8.0 needed by php-pecl-zip-1.19.5-1.fc34.remi.8.0....
user avatar
  • 1
0 votes
1 answer
68 views

Need to enable gd for an older version of PHP

The PHP version is 5.6, so quite old. Using apt-get install php5-gd won't work any more. I can locate these gd.so: /usr/lib/php/20151012/gd.so /usr/lib/x86_64-linux-gnu/libgd.so.3 -- links to 3.0.0 ...
user avatar
0 votes
0 answers
153 views

PHP not working after debian dist-upgrade

I recently upgraded from debian 10.10 to 11 My website had stopped working properly. It was showing php code instead of actual formatted page Thinking that It was due to not-working apache2 with php I ...
user avatar
0 votes
0 answers
745 views

CentOs 7 Php sudo yum install php-mysql error

I'm trying to install php but I got an error on the CentOs7. When I'm typing the; sudo yum install php-mysql There is an error occurs Last metadata expiration check: 1 day, 0:39:55 ago on Thu 16 Sep ...
user avatar
1 vote
1 answer
118 views

Selinux: type=anom_abend for php-fpm, Error 502 while accessing the application

Hi I am using nginx server which is hosting a web application in RHEL OS with selinux in enforcing mode. On accessing the application I am getting the 502 bad gateway error and on checking the audit ...
user avatar
0 votes
1 answer
94 views

Why can't ECHO be disabled (disable_functions) in PHP-FPM pools or php.ini?

You will find that echo can't be disabled. It's ignored and it and does not throw any error either when you restart the php-fpm service. There's probably no real reason that would lead you to ...
user avatar
0 votes
1 answer
55 views

what is the safe/secure way to execute commands from website?

I'm working on a website from which some services are generated and need to be placed on the system folder, and those services might also need to start/stop using the systemctl command. Both commands ...
user avatar
  • 5
0 votes
0 answers
45 views

How to install PHP Trader PECL using Linux

I'm using Dreamhost VPS server and I have SSH access but not sudo commands. I' have tried to install the PHP Trader Pecl library [psxxxxxx]$ wget "https://pecl.php.net/get/trader-0.5.1.tgz" [...
user avatar
0 votes
1 answer
70 views

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 ...
user avatar
  • 182
2 votes
1 answer
489 views

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 ...
user avatar
  • 1,718
0 votes
0 answers
18 views

PHP - get datetime when jpg file at URL has been accessed last time

I know the date-time is saved in the access log, but I think its not possible to read this file from php. What is the easiest way to find out the date and time when a specific file (jpg) has been last ...
user avatar
1 vote
1 answer
50 views

Alternative to suphp?

After a very long time since I installed suphp 5.* into my server, today I wanted to upgrade to php7.4 or php7.3, but I've found out that suphp is no longer maintained! And my knowledge is outdated ...
user avatar
0 votes
0 answers
60 views

Unable to link Postgres libraries while compiling PHP

I am attempting to compile, make and install PHP 7.3.27 alongside Apache 2.4.39 using this set of commands: ./configure --enable-fpm --disable-fileinfo --enable-bcmath --enable-calendar --enable-...
user avatar
  • 183
0 votes
2 answers
407 views

How to install PHP on CentOS has preinstalled Apache HTTPD?

I'm using CentOS 7. I wanted to install PHP 7 so I used remi-php (latest PHP version of yum is 5.4). Since the HTTPD version of yum is too old, I compiled the latest HTTPD version from the source code....
user avatar
0 votes
1 answer
108 views

php exec/shell_exec behavior CLI vs CGI

I am trying to use php to run some system commands and am getting a behaviour that I don't fully understand. If the php script is run from the command line I get the results I expect. But running it ...
user avatar
0 votes
0 answers
36 views

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 ...
user avatar
  • 1,035
1 vote
1 answer
721 views

php build error: please reinstall BZip2 distribution

I tried to build PHP v8.0.0 from its source but after running ./configure it says: ... checking for BZip2... not found configure: error: please reinstall BZip2 distribution But I have bzip2 installed ...
user avatar
  • 129
0 votes
2 answers
111 views

Execute an shell script with php in a safe way

I'm working on a technically breakthrough for a web interface (php) to process audio files with a separation module (spleeter https://github.com/deezer/spleeter). My demo app didn't work. See below. ...
user avatar
  • 11
0 votes
0 answers
162 views

Error in installing php on debian

I am installing Passbolt on debian system. While installing, I am getting the below error- Reading state information... E: Unable to locate package php7.0-intl E: Couldn't find any package by glob '...
user avatar
0 votes
1 answer
168 views

Error when Deploy PHP to Azure Web App using Jenkins Pipeline

I'm stuck at the jenkins stage to deploy from github repo to azure web app. stage('Deployment to Staging') { azureWebAppPublish appName: 'app1', azureCredentialsId: 'cred1', ...
user avatar
0 votes
0 answers
26 views

Need help about PHP 7.4.19 with Apache 2.4.46 on RHEL 7.2 - PHP missing intl extention

It's me again. After I finished installing Apache 2.4.46 with PHP 7.4.19. I then access my own web with local IP. The PHP modules loaded fine and I could access phpinfo.php. However, when I accessed ...
user avatar
0 votes
0 answers
37 views

Process gets killed nohup

I am running a Nohup script as a Module of another PHP Script. It does Actions for 5 min then sleeps for around an hour and does actions again after the sleep time. My Problem is that it gets killed ...
user avatar
1 vote
0 answers
24 views

Download file from URL with redirection, completely automatic at the CLI, replacing browser operation

I have asked Download file from URL with redirection, "?" and other symbols, from the command line curl -L did not get the correct file right away. A couple of comments pointed to a way ...
user avatar

1
2 3 4 5
19