Skip to main content

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
1 vote
0 answers
88 views

gsutil fails with "OSError: Operation not permitted" when running from cron

I have a php script that does backups. The backups have been failing, because one of the first commands throws an error and stops the script. When I run the script in the terminal, it works just fine. ...
Kenny Wyland's user avatar
0 votes
1 answer
594 views

Can not compile php-curl ext with custom curl

I have libcurl installed here: /usr/local/curl-7.88.1/ I want to compile php-curl extension: # cd /usr/src/php-8.1.12/ext/curl/ # /usr/local/php81/bin/phpize Configuring for: PHP Api Version: ...
Nick's user avatar
  • 872
0 votes
0 answers
633 views

PHP on IIS 10 , site running slow

I have IIS 10 running on windows server 2022, wordpress website running php is setup on iis. Everything was working fine until we decided to upgrade php from 7.4 to 8.0. now the website is painfully ...
Learner's user avatar
0 votes
2 answers
166 views

Apache cannot find PHP

I have a shortcut: c:/path/to/app1/current_php-cgi.exe.lnk I am trying to do this: FcgidWrapper "c:/path/to/app1/current_php-cgi.exe.lnk" .php And Apache has no issue with the syntax but ...
MonkeyZeus's user avatar
0 votes
0 answers
130 views

Laravel Crons on Elastic Beanstalk Linux AMI 2

I am running a Laravel app on Elastic Beanstalk Linux AMI 2. I am using the following config file in the .ebextensions folder to set up the cron. files: "/etc/cron.d/schedule_run": mode: &...
ackerchez's user avatar
  • 119
0 votes
0 answers
330 views

PHP failing to start (stalling) on Debian 12 fresh upgrade

I just upgraded to Debian 12 on my home server and noticed that my PHP webpages were broken. I already started the obvious : reboot apt update && upgrade apt install php --reinstall systemctl ...
gugo's user avatar
  • 1
0 votes
1 answer
124 views

php multiple reffering domains not working

with single domain as reffering domain code works fine <?php $referrer = $_SERVER['HTTP_REFERER']; if (preg_match('~site1\\.com$~', parse_url($referrer, PHP_URL_HOST))) but when i add more sites ...
johnsow's user avatar
0 votes
2 answers
259 views

Failure to Update Maximum Upload Limit Set By Hosting Provider and PHP Max Input Vars

Hi I deployed a VM with Wordpress only I can't update the Maximum Upload Limit Set By Hosting Provider value from 2M to 40M. I also can't update the PHP Max Input Vars value , despite we have modified ...
Massimo Sparavigna's user avatar
0 votes
1 answer
121 views

Nginx sets HTTP_HOST to punycode

I have a unicode domain name. It is configured as punycode in the server_name directive. When I call $_SERVER['HTTP_HOST'] in my PHP code, I get that same punycode version. How do I configure Nginx to ...
ᴍᴇʜᴏᴠ's user avatar
0 votes
0 answers
1k 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 ...
pileup's user avatar
  • 239
0 votes
1 answer
337 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 ...
Ekky's user avatar
  • 101
0 votes
0 answers
159 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 ...
Gökhan G.'s user avatar
0 votes
0 answers
1k 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 ...
A. Cedano's user avatar
  • 101
0 votes
1 answer
87 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 ...
IT_Guy's user avatar
  • 1
0 votes
0 answers
694 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 ...
Bursuc Sergiu's user avatar
0 votes
0 answers
40 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 ...
Huw Evans's user avatar
  • 101
1 vote
1 answer
465 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 ...
Rahat's user avatar
  • 11
0 votes
1 answer
210 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 ...
Tom's user avatar
  • 289
0 votes
1 answer
259 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 (...
Johnny's user avatar
  • 101
0 votes
0 answers
53 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 ...
mehtab fatima's user avatar
0 votes
0 answers
305 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 ...
w3jimmy's user avatar
  • 143
0 votes
1 answer
613 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 ...
Guido Goluke's user avatar
0 votes
0 answers
35 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 ...
pileup's user avatar
  • 239
0 votes
2 answers
3k 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....
Alien Life Form's user avatar
0 votes
0 answers
83 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 ...
DevelJoe's user avatar
  • 187
0 votes
1 answer
738 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 ...
Nuno's user avatar
  • 633
0 votes
0 answers
197 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 ...
szlev's user avatar
  • 1
0 votes
1 answer
70 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; #...
Evgeny's user avatar
  • 1
1 vote
1 answer
201 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 ...
xebeche's user avatar
  • 363
1 vote
2 answers
381 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 ...
frumious's user avatar
  • 123
0 votes
0 answers
53 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 ...
Levi Cole's user avatar
  • 101
0 votes
0 answers
101 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 ...
JimmyP624's user avatar
0 votes
0 answers
373 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 ...
Vasilis Lourdas's user avatar
1 vote
0 answers
953 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. ...
Arturo's user avatar
  • 11
0 votes
0 answers
218 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 ...
Michael T's user avatar
  • 121
1 vote
2 answers
994 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
majid lateef's user avatar
0 votes
0 answers
59 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 ...
Henrik Schultz's user avatar
0 votes
0 answers
117 views

Nginx 502 Bad Gateway CentOS7, PHP 7.3.33 FPM

I am new on CentOS 7. Trying to install Postfix on centOS7 with Nginx. I am following a tutorial, but I get an error message. I have a 502 Bad Gateway on my server, http://domainname.com , how do I ...
dhanu gulati's user avatar
0 votes
0 answers
12 views

Integrated Windows Authentication with Apache on Windows [duplicate]

I'm using XAMPP and I want to use my app on my intranet, because of this I don't want to create another login page and I want to use the authentication from windows and to work with the username ...
Mega's user avatar
  • 101
0 votes
0 answers
204 views

How to configure Lychee server? apache error 500

os AlmaLinux 9.1 Apache/2.4.53 PHP 8.2.4 try to install Lychee with postgreesql my httpd.conf ServerRoot "/etc/httpd" Listen 0.0.0.0:80 Include conf.modules.d/*.conf User apache Group ...
Andrey Starkov's user avatar
0 votes
0 answers
257 views

I'm dockerizing my website setup. What is the best approach to send mails by PHP-FPM in a container?

So i've seen a couple of questions about setting up notifications for PHP-based websites, so i'd like to ask you for the best approach. For that, I have: a WordPress website with custom PHP packages ...
Radosław Serba's user avatar
1 vote
1 answer
960 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 ...
eezetee's user avatar
0 votes
1 answer
867 views

Diagnosing mySQL Random CPU Spikes

Our organization has a fairly advanced (as in many moving pieces) web application that's been working great up until recently, yet no noticeable changes have been made. There is the Apache Web Server, ...
Johnathan Martin's user avatar
1 vote
1 answer
350 views

PHP-FPM static max_children amount doesn't seem to matter much during stress tests

I've been stress testing PHP-FPM set up as static using wrk, with NGINX running on Ubuntu Server 22.04 for the past few days, writing down results for every scenario. When I look at them, it seems to ...
Medito Di Terra's user avatar
-1 votes
1 answer
32 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 ...
Michael Griffith's user avatar
0 votes
0 answers
456 views

Apache server working, PHP isn't

I had a php tool working on my old macbook pro. I've recently install via homebrew the HTTPD server and install PHP per a few websites. The local page loads but it seems that PHP isn't working ...
eezetee's user avatar
0 votes
1 answer
782 views

Nginx header HTTPOnly closing user sessions

I'm using an Nginx server to host an PHP web application, and tried to upgrade its security by using some security headers, I've tested it on a staging environment and it works fine, so I've decided ...
Murilo Melo's user avatar
1 vote
0 answers
83 views

How to redirect using .htaccess in Apache

I am using the following .htaccess rules to redirect the url for following conditions: RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^$ https://example.com/page.php [L,R=...
Bvc...'s user avatar
  • 111
0 votes
1 answer
275 views

Trying to install Horde with php8.0/php7.4

AlmaLinux 9, LAMP up-to-date. Acouple of weeks ago I tried to install Horde webmail but I gave up after “install failed”. That time I followed pre requisites ++. Now I am trying it again. I created a ...
Daniel Franco's user avatar
0 votes
1 answer
89 views

WordPress > bbPress > Search > PHP Fatal error: Allowed memory size exhausted

CentOS Linux 7.9.2009 (Core) Plesk Obsidian 18.0.51 PHP 8.1.17 (up-to-date) WordPress 6.2 (up-to-date) X Theme 10.1.10 (up-to-date) php.ini memory_limit 512M (confirmed by checking the phpinfo() page) ...
stevland's user avatar
  • 165