As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [php]

PHP is a general-purpose scripting language that is especially suited for Web development. The online manual is an excellent resource for the language syntax and has an extensive list of the built-in and extension functions. Most extensions can be found in PECL.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

How to change the value of "Configuration File (php.ini) Path"?

I have a few PHP apps running on IIS 10. I set each app the right PHP version for it, and it works correctly, and the Loaded Configuration File shows the right path for each, however, only the apps ...
2 votes
1 answer
4k views

AWS EC2, Apache, PHP: php_network_getaddresses: getaddrinfo failed

Running PHP 5.6 on an EC2 instance with Apache 2.4.18, I'm occasionally seeing errors in the log when trying to connect to an RDS database: PDO::__construct(): php_network_getaddresses: getaddrinfo ...
0 votes
1 answer
4k views

How To Fix Padding Oracle (CVE-2016-2107) On Ubuntu/Apache/PHP

I am trying to fix CVE-2016-2107. I consulted several sites, which do not seem to provide a clear answer for all cases: I use Apache2 2.4.12 with PHP 5.5.26. I ran: apt-get install openssl libssl-dev ...
2 votes
0 answers
223 views

httpd on OpenBSD: How to Redirect URLs Ending In '.php'?

I am running an httpd(8) web server on OpenBSD. php-8.1.9 is used to serve php. In /etc/httpd.conf I have the following (example.com is a placeholder for the actual domain): server "example.com&...
0 votes
1 answer
75 views

Frequent server downtime and suspicious server hits to access random Pdf files

Our Server hosting PHP web application is facing frequent downtime Server Information [Nginx, FreeBSD] Web application [PHP 5.6, MYsql 5.7] I have gone through the Nginx logs and below are my findings ...
0 votes
0 answers
20 views

php sqlsrv error TCP Provider: Error code 0x271D

when i run php script from browser sqlsrv mssql connection working. but when i execute php script via ssh command "/opt/alt/php-fpm70/usr/bin/php path/to/script.php" sqlsrv_connect give this ...
0 votes
0 answers
37 views

Error 500: Internal server error deploying Symfony 6 application on shared hosting (Apache)

I have successfully deployed my application to a remote host using Deployer. I'm on shared hosting and I don't have access to the Apache configuration. The application is deployed in a directory ...
0 votes
1 answer
33 views

Code Changes for Apache Server Upgrade [closed]

The security team found a loophole in Apache version 2.4.23 so we need to upgrade Apache to version at least 2.4.56 or later. However, the developers told me it required a lot of code changes (around ...
0 votes
1 answer
4k views

Let php PDO work with newest version of PostgreSQL (Debian/Ubuntu)

I installed PostgreSQL and the php PDO driver on my 14.04 Ubuntu like this: sudo apt-get install postgresql postgresql-contrib sudo apt-get install php5-pgsql Which installed PostgreSQL 9.3 and ...
-1 votes
1 answer
23 views

Trouble Formatting Nginx Server Block

So I'm trying to set it up where my subdomain: "forum.project-freedom.net" visits the directory of /var/www/forum/ on my server. I'd like the main URL, "project-freedom.net" to be ...
0 votes
1 answer
33 views

Cannot execute PHP binary as non-root user in Plesk server (Linux)

I am running Plesk 18.0.44 on my Debian 9.13 server. It has multiple subscriptions and hence different users for these vhosts. I was always able to run /opt/plesk/php/7.4/bin/php -v as a vhost user (...
5 votes
5 answers
4k views

Multiple instances of MediaWiki on one server

We need to run several MediaWiki Wikis, that need totally separate user accounts, on the one server. What would be the better solution: Use separate source code and use namespaces in the database. ...
1 vote
2 answers
213 views

Add causing php-script to mysql-slow.log

If you enable the line log_slow_queries = /var/log/mysql/mysql-slow.log in /etc/my.cnf or /etc/mysql/my.cnf then that will log all queries, that take longer than the setting in long_query_time. ...
1 vote
1 answer
34 views

Two PHP sites under Docker + nginx cant communicate with each other

I am using Docker + NGINX to host two PHP sites. The sites are accessible from the outside but the problem arises when I try to access one site from another using cURL or file_get_contents. The ...
3 votes
1 answer
5k views

Why is Apache creating so many internal dummy connections? CPU usage issues affecting server performance

Trying to get on top of some CPU usage issues and investigate possible malicious activity. As part of this I am curious about lots of dummy connections in the Apache logs. What is the origin of these ...
0 votes
0 answers
43 views

PHP-FPM unable to find or access status shared memory

I am running a busy magento 2 load balanced web server with 3 back-end PHP-FPM servers and a shared EFS network filesystem on AWS cloud. There are lots of concurrent users and everything works fine ...
0 votes
0 answers
13 views

AWS WAF create custom rules

Attackers are repeatedly using the same off-the-shelf exploit to attack my server. It doesn't work because my server is patched and I have some server side modules to prevent the exploit. However I ...
0 votes
1 answer
16 views

NGINX proxy fails to disconnect sessions on target Apache server

I have a PHP script running on an Apache server which is responsible for disconnecting all user sessions. For that, it makes a loop that identifies itself as the session that should be disconnected ...
0 votes
0 answers
16 views

I want to add a custom 404 to all my URLs following a relevant pattern using .htaccess file

Hello, Google is currently indexing query string URLs of my website. Google has currently indexed almost 112k URLs that all of are duplicate versions of other URLs causing my website to slow down and ...
0 votes
0 answers
60 views

NGINX + PHP + ASDF: asdf plugin is using PHP 5.6 instead of 7.4

Goal: I need to load a PHP website (7.4) running NGINX using ASDF plugin. (Mac OS, M2 processor, NGINX and ASDF installed) issue: when I load the website via nginx I get this: Fatal error: Composer ...
63 votes
12 answers
322k views

104: Connection reset by peer while reading response header from upstream (Nginx)

I have a server which was working ok until 3rd Oct 2013 at 10:50am when it began to intermittently return "502 Bad Gateway" errors to the client. Approximately 4 out of 5 browser requests succeed but ...
0 votes
1 answer
58 views

which memory limit applies when php performs a MySQL query

If I run php as FPM, I can set my memory limit in php.ini or .user.ini. PHP can perform a MySQL query, and I can set memory limits in /etc/my.cnf for for instance the innodb buffer pool. If PHP runs ...
4 votes
1 answer
7k views

Send mail service start error

I installed sendmail on CentOS based on some tutorial. When I start sendmail, it showing sendmail failed error. Here the following command result: systemctl status sendmail sendmail.service - ...
0 votes
1 answer
51 views

Do not log access to some php scripts

I would like to exclude from access.log access to some php scripts. To do this, I did the following: location ~ ^/lib/exe/(jquery|taskrunner|css|js)\.php$ { access_log off; #...
0 votes
0 answers
12 views

Moved app to Default Application Pool with ApplicationPoolIdentity and there are permission errors

Running a PHP 8.2 app. I changed the app to use the Default Application Pool under the user ApplicationPoolIdentity instead of the previous Custom pool and custom account, but now I get: The stream ...
0 votes
1 answer
38 views

How is php-fpm socket folder ({/var,}/run/php-fpm) created on Linux?

I am setting up multiple php versions on CentOS7 (native and from remi repos). As installed, the native php-fpm ( is setup on a unix socket, while the (remi) php74-php-fpm would listen on a TCP socket....
0 votes
2 answers
161 views

NGINX config for the subdirectory app using Slim Framework

Need help editing the config below. I have main site in / and another app (api) in the folder /api. I'm using Slim Framework, so it has accesible index.php file in /api/public. Now, I'm trying to be ...
2 votes
2 answers
10k views

Equivalent of PHP setlocale in an APACHE config file

I need to display a date in french locale. A solution is to use setlocale(LC_TIME, 'fr_FR'); But I'm looking to set the locale directly in the configuration of my apache server. In the /etc/httpd/conf/...
0 votes
2 answers
293 views

Stuck on php8.1 when downgrading to php7.4

I upgraded the php version on my Apache server running on Debian (buster) from 7.3 to 8.1. Due to an older Nextcloud installation I had to downgrade to php7.4. The downgrade worked well following ...
0 votes
0 answers
22 views

Secure location of PHP files used in LAMP stack

I'm setting up a LAMP stack on Ubuntu 20.04, and had this recent discussion with a colleague about the fact that it's better to not keep the PHP scripts of all of your stack (classes, API Controllers ...
0 votes
0 answers
62 views

How was apache2 able to use 8+GB ram "in idle"? (oom-killer)

I bought a vps in Contabo, using ubuntu22, installed apache2, php, mariadb.Sometimes the apache2 uses all of my memory. Literally all. At idle, not really anything was running. A php process was ...
0 votes
1 answer
65 views

Why does curl inside Docker to a subdomain in the same Host use private IP address?

Consider I have docker-subdomain.mydomain.com pointing to a website in a Docker container, and host-subdomain.mydomain.com pointing to a website in the Host itself. Both these websites are in the same ...
1 vote
1 answer
44 views

Find what paths are required for open_basedir?

We have a server (running PHP-FPM 7.4 on Apache) that hosts various scripts, frameworks and applications like DokuWiki. It's grown to a pretty complex beast. We would like to apply an open_basedir ...
1 vote
2 answers
10k views

How to enable/disable PHP extension for PHP CLI if there is no loaded configuration file?

I just executed php -i | grep "Loaded Configuration File" to find out where the configuration file of my PHP CLI is stored, but I get: Loaded Configuration File => (none). So it loads the ...
0 votes
1 answer
3k views

Unable to enable mpm-event in httpd | centos 7

I am kind of new to mpm and all so please don't mind. I have a web server running 8 websites (php based) on it. And my RAM usage goes over 90 % and the swap usage goes over 80 %. And when i check ...
1 vote
1 answer
34 views

What determines the name of Apache PHP Handlers?

When configuring an Apache server to use a Handler to run PHP code, I'm familiar with adding a line similar to below in httpd.conf or .htaccess: AddHandler application/x-httpd-php81 .php This tells ...
0 votes
0 answers
14 views

Isolating a WordPress wesbite within a sub-directory of another

Is it possible to isolate a website within a sub-directory of another on a WHM server? And by isolate, I mean in the event that website within the sub-directory is compromised any malware is contained ...
0 votes
0 answers
22 views

Stripe Custom PHP & JavaScript Stripe Integrations: form refuses to load

I'm attempting to create a webpage for my startup, which is subscription-based. We have Stripe in live mode, and are essentially storing cards for future use, allowing us to have different payment ...
0 votes
0 answers
32 views

nginx as reverse proxy for different PHP backends

I maintain two Debian Linux servers, A and B. A is rather old and runs a old PHP installation (5.4), while B runs a newer (7.2). Both run Apache as a web server. Server A uses PHP as a module, while ...
0 votes
2 answers
9k views

fastcgi php and memory limit

I have a web server apache 2.2 with fastcgi and php 5.3, I have memory limit set to 256MB in php.ini and with php-cgi -i I got 256MB. So the configurations is correct, my process read it without ...
1 vote
0 answers
81 views

MAMP Websites taking more than 20-25 secs to load, but sometimes

I'm using MAMP Pro on my Mac (Monterrey) and since a couple weeks I've been having a strange problem. After several tests I've been unable to find out where the problem is, but this is what happens. ...
4 votes
5 answers
5k views

Rewrite rule for nginx (Opencart)

Opencart has this URL structure: http://example.com/index.php?route=common/home http://example.com/index.php?route=account/register http://example.com/index.php?route=checkout/cart http://example.com/...
0 votes
0 answers
16 views

php.ini file setting being ignored - tring to change upload_max_filesize

Running php8.2 with fpm - I have rebooted server, I have restarted both php8.2-fpm and apache2. I am 100% certain I've changed the correct php.ini file - infact I have changed all 3, apache2, cli and ...
0 votes
2 answers
70 views

CPU Usage 98% /usr/sbin/mysqld and server down

How to solve this issue. php codeigniter framwork Everyday our server goes down because of these issue. CPU usage 98 % Ram used 21 083 MB /usr/sbin/mysqld
0 votes
0 answers
16 views

PHP 7.4 FPM under Nginx serves wrong class from cache

We have a Linux environment serving a few different applications, all written in PHP 7.4. They are served out of a single Nginx web server using virtual hosts, and are all using FPM. In our code we ...
1 vote
1 answer
16k views

Fatal error: Incompatible file format: The encoded file has format major ID 1, whereas the Loader expects 4 in ... on line 0

I am using Ubuntu 10.04 and for some time I had to keep a downgraded PHP 5.2 package because I need to run Zend encrypted scripts. Recently I noticed that Zend released beta version of their loader (...
1 vote
2 answers
5k views

Unable to bind to server: Can't contact LDAP server

Environment: LDAP Server Type: ActiveDirectory LdapRecord-Laravel Major Version: v2.5 PHP Version: 8.0 I'm using ldaprecord and I'm getting "ldap_bind(): Unable to bind to server: Can't contact ...
0 votes
0 answers
16 views

Getting error while sending mail from postfix admin

I am getting below error while sending mail from postfix admin. [error] 8842#8842: *183397 FastCGI sent in stderr: "PHP message: fsockopen failed - errno: 111 - errstr: Connection refused" ...
3 votes
2 answers
3k views

php-fpm: why do I have a process memory usage higher than memory_limit

I know that there are a lot of related subjects, but I did not found my answer. I have a dedicated server with 32Go of RAM (but I want php-fpm to use only 12Go max), and I have a php-fpm (7.2.13) ...
1 vote
1 answer
180 views

Simple PHP calling Python script - Call not working

I've got a simple localhost website with a php page that has some buttons on it that call python scripts. I can run it locally and the output works so standalone the scrip is fine. The issue is with ...

1
2 3 4 5
158