Skip to main content

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
0 answers
34 views

Writing to HTML file at a specific part using php

I am trying to write to a specific part of a HTML file using PHP with sed or awk or any other way. I want to add some text before </article> The following code I have does not work exec(“sed -i ‘...
Detonator120's user avatar
2 votes
1 answer
186 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 ...
Thomas Weller's user avatar
0 votes
0 answers
9 views

Apache configuration to host both PHP and Python backend together not working for special Alias requirement

I am working on a web application in Ubuntu. I have a PHP backend that I want to host in "http://localhost/myapp/". All the application files are in the "/var/www/html/myapp/website/...
zeit's user avatar
  • 1
0 votes
0 answers
21 views

Can't run php page in RedHat satellite

i'm using RedHat satellite 6.15 in RHEL 8. We want to add some php web page like dokuwiki/racktable there. But i have problem that if i install php and put php files in /var/www/html/pub/ directory, I ...
Neci's user avatar
  • 1
0 votes
0 answers
30 views

This causes error in php file shell_exec('/home/cjm/.local/bin/yt-dlp')

shell_exec('/home/cjm/.local/bin/yt-dlp') causes this error: yt-dlp: error: You must provide at least one URL. Type yt-dlp --help to see a list of all options. Traceback (most recent call last): ...
witgrefe's user avatar
0 votes
0 answers
16 views

Upgraded from Debian Jessie to Stretch but php -v still shows using 5.6.40?

The webpage at https://wiki.debian.org/PHP says Stretch should be using PHP 7 but after I upgraded from Jessie to Stretch typing: php -v at the command line says it's still using 5.6.40 How do I use ...
user3161924's user avatar
0 votes
1 answer
31 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 ...
Darwick's user avatar
  • 125
0 votes
1 answer
131 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 ...
Anarkie's user avatar
  • 233
0 votes
0 answers
42 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-...
Cris's user avatar
  • 1
0 votes
0 answers
111 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 ...
user24198409's user avatar
0 votes
0 answers
277 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 ...
Hải Phạm's user avatar
0 votes
1 answer
26 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 ...
cookie's user avatar
  • 222
0 votes
0 answers
92 views

Another FPM instance seems to already listen on /run/php-fpm/www.sock

When I start php-fpm on a RHEL9.2 system I get the error Another FPM instance seems to already listen on /run/php-fpm/www.sock My php version is 8.0.30 Every time I have to create /run/php-fpm on ...
Darcy Walter's user avatar
0 votes
1 answer
168 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 ...
Fabriccio Bogdanoff's user avatar
0 votes
0 answers
257 views

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 ...
Janam Maharjan's user avatar
0 votes
0 answers
18 views

How to configure Postfix with PHP on web server to rewrite to hosting domain, not to server FQDN?

I might not phrase the question corectly as I obviously have limited knowledge. So hope I will explain corectly. I setup Ubuntu + LiteSpeed web server with PHP. I intend to run a dozen of web pages ...
Labsy's user avatar
  • 1
-4 votes
2 answers
103 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/...
amir salarr's user avatar
0 votes
0 answers
270 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 ...
Dans988's user avatar
-1 votes
1 answer
59 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 ...
Dimitrios Desyllas's user avatar
0 votes
1 answer
200 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....
Ivar's user avatar
  • 1
0 votes
0 answers
42 views

mod_remoteip not showing true ip of the visitor

I am trying to get the real ip behind cloudflare I did as I found on google , installed mod_remoteip then configure it as following : LoadModule remoteip_module modules/mod_remoteip.so ...
Zeyd Lprn's user avatar
0 votes
2 answers
117 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/...
bungee1980's user avatar
1 vote
1 answer
183 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 ...
doraemon's user avatar
  • 111
0 votes
1 answer
241 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 ...
Schubi Duah's user avatar
0 votes
2 answers
857 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....
icalvete's user avatar
  • 101
2 votes
1 answer
122 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 ...
Hayden Thring's user avatar
0 votes
1 answer
584 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 ...
coyote's user avatar
  • 101
0 votes
2 answers
94 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 ...
Dimitrios Desyllas's user avatar
0 votes
1 answer
59 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 ...
Edderpet's user avatar
0 votes
0 answers
93 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 ...
Jaquarh's user avatar
  • 101
0 votes
0 answers
24 views

PHP-FPM - "IntlException thrown"

I have correctly installed php-8.1.23, php-fpm and php-intl-8.1.23 on OpenBSD 7.3 When I create a file locally with the following code and run it with PHP $example_var = new Collate('en_US'); it ...
prmethus's user avatar
0 votes
0 answers
58 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 ...
Rik's user avatar
  • 1
1 vote
1 answer
308 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 ...
Santiago Martinez's user avatar
0 votes
0 answers
31 views

Set cache-control in .user.ini

I have a new AlmaLinux 9 installation with apache and php installed. I am converting my .htaccess files to .user.ini Although going well, I can't figure out the user.ini equivalent of the following:...
TSG's user avatar
  • 1,768
0 votes
0 answers
23 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 ...
TSG's user avatar
  • 1,768
0 votes
0 answers
552 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 &...
Carlos Fernandez Deus's user avatar
4 votes
1 answer
125 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....
Jasmin's user avatar
  • 41
2 votes
1 answer
602 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....
realtebo's user avatar
  • 957
0 votes
1 answer
170 views

apache, php-fpm and mod_fcgid - unable to write to file

I have install apache, php-fpm and mod_fcgid, and trying to write to file. I have created PHP pools, here's the config files: [test.internal.innovisage.com] ... user = test group = test ... listen....
supmethods's user avatar
2 votes
1 answer
676 views

php_value settings in .htaccess

I am in the process of migrating an Apache WordPress site from CentOS7 to AlmaLinux9. I installed standard LAMP stuff on the AlamLinux9 system, and restored the MySQL and copied over the html ...
TexasTim's user avatar
0 votes
1 answer
585 views

PHP was compiled with zlib module, but phpinfo() show it's disabled

In order to use Joomla! 4.3.1, I've compiled PHP 8.2 in an Oracle Linux 8.6 Server, with support for zlib compression: # php --ri zlib zlib ZLib Support => enabled Stream Wrapper => compress....
Juliano B. Nequirito's user avatar
0 votes
1 answer
89 views

Ubuntu - Always use certain php version for certain directory

I have multiple PHPs (8.1 and 7.3). If I execute php -v then I get 7.3. I need to execute some command with PHP for magento 2 e.g. php bin/magento cache:flush, but I need to call it with php 8.1 for a ...
Black's user avatar
  • 2,098
1 vote
4 answers
1k views

Install memcache for Wordpress on debian with php-fpm

The install instructions for memcache are not really up-to date. How do I install on Debian using php-fpm and nginx? I tried this: apt install memcache zlib1g-dev php-dev pecl install memcache This ...
rubo77's user avatar
  • 29.4k
2 votes
0 answers
570 views

getting php readline extension to work in php 8 xampp installation

i have a fresh install of linux mint 21.1 as well as the latest version of xampp which comes with php 8.2.4. i added export PATH=$PATH:/opt/lampp/bin to .bashrc to access php from the terminal. it ...
bungee1980's user avatar
0 votes
1 answer
93 views

My file is reinfected as soon as I chown back to user:psacln

I can turn off write permissions on the directory and remove the file using rm -v filename. I can recreate the file using touch filename and even add contents using nano filename. But, as soon as I ...
David Davis Jr.'s user avatar
0 votes
1 answer
2k views

upgrade to php 8.* version on centos 7.9

I have a Centos 7.9 with PHP 7.4.33 pre installed. followed this command steps for upgrading the php version to 8.1: sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm sudo ...
Pooya Behravesh's user avatar
0 votes
0 answers
312 views

RHEL 9.1 - SELinux is preventing /usr/local/bin/php from read access on the file /web/inc/init_db.inc.php

i want to solve this problem what SELinux says. SELinux is preventing /usr/local/bin/php from read access on the file /web/inc/init_db.inc.php. output from console is: [root@rhel ~]# ausearch -c 'php'...
ArchMatt's user avatar
0 votes
2 answers
119 views

Where is this php directive being overriden

The error message AH01071: Got error 'PHP message: PHP Warning: POST Content-Length of 17826104 bytes exceeds the limit of 8388608 bytes in Unknown is normally fixed by changing the pair of related ...
VagrantPaladin's user avatar
2 votes
1 answer
20k views

How to enable the PHP DOM extension?

I have a server that has PHP 7.4.3 installed, but it doesn't load PHP-DOM. It's not listed in php -m or php -i, nor when I load PHP on a page. Here's what I tried so far: Ran sudo apt-get install php-...
lastnoob's user avatar
  • 121
0 votes
0 answers
71 views

Giving www-data access to i2c

I have a light sensor that uses I2C for data transmision. Now I want to display that data on a Website. The problem is www-data can't access I2C. I use a Python script that gets run by PHP (I know it'...
Bhasim's user avatar
  • 1

1
2 3 4 5
20