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
11 views

Nginx config rewrite .php working but forms broke

I am having trouble with the Nginx default config for my website. My PHP website runs on a linux azure machine, which uses nginx. This is currently my config: server { #proxy_cache cache; #...
0 votes
0 answers
21 views

Duplicated WP Multisite for testing environment is redirecting to production site

My goal is to have a test.example.de testing environment for my www.example.de WP Blog. Sadly, the site is still redirecting me to the production-site. My subdomain is registered as a CNAME with a TTL ...
2 votes
1 answer
4k views

Secure PHP on IIS 8.5

I'm using IIS 8.5 on Windows Server 2012 R2 to host ASP.NET and also PHP-Applications. Because there are a few different PHP-Apps, I want to restrict the access by using open_basedir. The problem: ...
0 votes
0 answers
15 views

apache2 seems stuck on fetching simple server-side-cached content

i've got a server up at https://nicer.app which recently became buggy in as much that it takes up to a minute for the background image to content to be shown. i wonder what if anything i did wrong ...
0 votes
3 answers
1k views

Errors installing the Curl library with PHP/Apache/Windows

I'm having a hell of a time getting Curl to work with PHP/Apache on my Windows XP 64-bit development box. I have PHP and Apache successfully installed, but when I tried to enable Curl I get the ...
15 votes
6 answers
39k views

Nginx - Route all requests to single script

I have a PHP script that handles script routing and does all sorts of fancy things. It was originally designed for Apache, but I'm trying to migrate it to nginx for a few of my boxes. Right now, I'm ...
0 votes
2 answers
80 views

PHP sock linked to update-alternatives choice?

In my nginx configs, I point to PHP as /var/run/php8.3-fpm.sock. Because there is a specific version in that path, using update-alternatives does not change the PHP version my websites use. How do I ...
0 votes
1 answer
60 views

PHP_FPM extensions not loading in Apache

I'm building out a web server on Rocky Linux 9 with Apache and PHP 8.3. I need the pdo_dblib extension. From the command line via "php -m" and "php-fpm -m", I see that the ...
0 votes
2 answers
3k views

Change in php.ini not reflecting PHP Memory_Limit Master Value

I am trying to install a composer package for AWS S3 integration and came across the Composer Out of Memory issue. Upon checking phpinfo() I could see the loaded php configuration file is /etc/php....
0 votes
1 answer
43 views

Check if package exists in repository that is not on my sources.list?

TL;DR: How can I check if a package exists in a repository that's not on my sources.list? What I want: Most answers I'm finding assume the repo I need to check is already in my /etc/apt/sources.list. ...
107 votes
2 answers
129k views

Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM

There are few different php "wrappers"(?). What are differences between them? Tried to google some, but cant seem to find informations. (mod-php is not googleable). Why might I choose one over ...
0 votes
1 answer
20 views

Apache2 Not Running Custom PHP App After Uploading to /var/www/html folder

I am installing a software that I bought. It's in PHP. So, I got a DigitalOcean server(ubuntu 22.04). Installed Apache2 and PHP 8.1. Now, when I upload files to /var/www/html folder, it does nothing ...
0 votes
1 answer
2k views

How do you upgrade mysql 4 to 5?

Ok so im fairly new to this and i know some of you will point my to mysql page but im having a hard time finding specific and explicit directions on saying "To upgrade..do this..do that..done" and ...
0 votes
1 answer
9k views

Nginx + PHP index.php not found 404

I'm running debian 9 with nginx 12 and php7.1 I've set evrrything up. Nginx does not give me anything in error log, all the PHP scripts are working 100% fine. Nginx indexes index.html as index but ...
0 votes
0 answers
62 views

version 10.6.6 when the installed package is version 3.2.6

I've built php 8.1 from source. one php app uses mysqli extension I get this warning: HP Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:100606 Library:...
1 vote
2 answers
362 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

Laravel Form Set Default Selection

@section('page-action') {{ Form::select('item_type', $product_type, null, ['id' => 'item_type', 'class' => 'form-control select ', 'required' => 'required', 'placeholder' => 'Type de ...
8 votes
2 answers
17k views

What does ALPN, server did not agree to a protocol mean?

I see this quite regularly when using various calls in curl. I'm not sure if its the root cause to some of my returns resulting in error 400 but as a newbie just curious more than anything.
0 votes
4 answers
4k views

mpm_prefork:error Cannot allocate memory

I was using a website called loadimpact to test how my php application would perform under a big amount of access. I did one really small test with only 50 virtual users accessing at the same time, ...
-1 votes
0 answers
20 views

cookies are not being, recongnized / regenerated, after some period of time

Authentication in Laravel doesn’t work some time after the deploy in a specific environment I have 2 web platforms built with Laravel that work perfectly fine both on the development environment as ...
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....
1 vote
1 answer
6k views

Unable to run python script from PHP

This particular question has been asked so many times with great suggestions but the sudden abandonment by Askers doesn't really help as they never bothered to return to tell what worked (assuming it ...
0 votes
0 answers
70 views

WP rest api and litespeed incompatibility

I have tried everything i could think of and searched on the on Internet for the last few days i'm spending ~10 hours per day trying to diagnose this. the issue: in WP Site Health i get: The REST ...
-1 votes
1 answer
72 views

Nginx error "upstream prematurely closed FastCGI request while reading upstream" with generated file download

I just spent the whole day trying to figure out this error. We have a PHP script that generates a file for download. After upgrading nginx (1.16 -> 1.24), this script suddenly started randomly ...
-1 votes
1 answer
2k views

How do you protect (PHP) source code from the web host?

So, you just created the next killer app, possibly in PHP. You have done everything to keep hackers out. There is no way they can steal the code! Except for someone from the web hosting company, of ...
0 votes
4 answers
8k views

How to set custom $_SERVER variable for PHP

I'm working on a PHP web app which ALSO has some command line tools. I need the command line tools to detect the environment so that they connect with the correct DB credentials etc. The web app does ...
1 vote
0 answers
24 views

Server forbids access to any URL ending in .php (even nonexistent ones) with "client denied by server configuration", but identical html files are OK

I'm trying to enable some php files on an Apache 2.4 machine that has no other php content. I'm finding that any php URL (even made-up URLs for nonexistent things) results in the error "client ...
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
57 views

Prevent PHP from reading own source files

For simplicity consider the following example: We have a file secret.php that runs our back end code and it includes a file custom.php somewhere a long the line. Obviously the apache-user must be able ...
0 votes
1 answer
4k views

No Match for argument: php5-mysql and No package php5-mysqlnd available

I came across the following warning : PHP Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50550 Library:50631 in /var/www/html/web_app/test/browser/dbconn.php ...
0 votes
1 answer
183 views

NGINX 403 ACCESS DENIED

I have this problem in nginx, it is a Laravel application. but it is in a user's folder /home/user/projects, I already tried with 777 nginx owner of the folders but it still shows the error FastCGI ...
0 votes
1 answer
92 views

imagick extension php loaded in command line but not load in httpd

I have installed imagick extension for php by command: pecl install imagick After that, I restart httpd and restart php-fpm. I checked imagick loaded in php command line but when use phpinfo() for ...
2 votes
1 answer
5k 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
0 answers
51 views

Correct way for creating apparmor hats in separate file

I'm trying to re-enforce the security of my LAMP config In my configuration, each website consists in : One Unix account One MySQL database accessible only from one MySQL account One VirtualHost ...
1 vote
1 answer
126 views

Apache: 500 error, PHP fails on just one specific path

I need another pair of eyes to help debug an issue. This will be a long message. I'm going to provide a lot of context because I'm not sure which details might be important. We have two servers: dev, ...
3 votes
2 answers
3k views

Why is PHP open_basedir not considered a security model

On servers doing shared web hosting, or sharing the PHP environment between different PHP applications, I usually implement a security policy that uses PHP open_basedir to restrict each user to his/...
1 vote
2 answers
4k views

PHP5 unmet dependencies when upgrading

Trying to upgrade PHP from 5.3 to 5.6 using the following: sudo add-apt-repository ppa:ondrej/php5-5.6 sudo apt-get update sudo apt-get install php5-common When I try this, I run into this error and ...
6 votes
2 answers
42k views

How to add a extention to the php.ini file

Hi have Centos 6 installed and busy installing wkhtmltopdf, I only have one step left and that is to include extension=phpwkhtmltox.so to the php.ini file, I added it to /etc/php.ini and reloaded ...
0 votes
4 answers
4k views

CGI error from PHP when running exec() on IIS

Windows Server 2003 x64 PHP 5.2 IIS 6.0 The program Ink2Png.exe is set with Everyone->Read and Execute permissions. As does its dependency (microsoft.ink.dll) PHP Safe Mode is off exec() is ...
0 votes
1 answer
803 views

install multple php version on centos 8

I have a server running on centos 8 PHP 7 is installed already and I'm new to centos 8. I used to use centos 7 and I use the 2 PHP versions 7 and 5 I am using the php5 for some older scripts until I ...
2 votes
5 answers
153 views

What do these profiling results mean?

I'm trying to switch a site from an old CMS to WordPress. I ain't got root. I can't install extensions. Vanilla PHP 5 install. So I just put microtime on each end, topped it off with ...
1 vote
2 answers
10k 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 ...
7 votes
3 answers
16k views

Error with PECL command in PHP7

I've upgraded php to version 7 and now I have problems with pecl command. When I run sudo pecl install mongo I get long list of errors: Warning: Invalid argument supplied for foreach() in Command.php ...
0 votes
1 answer
92 views

Why Memcached is empty

I've added memcached to LAMP stackand Wordpress and everything seems fine except the memcached memory is empty. When I check with memcdump --servers=127.0.0.1 it returns nothing. Also when I connect ...
3 votes
1 answer
12k views

Zabbix PDF Report Generation

if any of you have an idea how to implement zabbix generate PDF reports? in forum I found some like this: https://www.zabbix.com/forum/showthread.php?t=24998 . I try implement this to my zabbix 2.2....
1 vote
1 answer
249 views

What is the best way to achieve SSO for Apache 2.4 within a Windows domain? [closed]

I would like to implement an SSO authentication (without login/password prompt) on a PHP 8 intranet app, which runs under Apache 2.4 x64 for Windows. My company has an Active Directory / LDAP / ...
4 votes
5 answers
6k 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/...
1 vote
0 answers
69 views

After migrating to Kubernetes, PHP kernel response times increased

There is an application written in PHP Symphony. The application is stateless, all code and statics are inside the application container. We moved it from docker to kubernetes, but after testing ...
0 votes
2 answers
191 views

How do I configure SE Linux so PHP can connect to Postgres by socket

I have a PHP application that connects to a Postgresql Database. This works when I connect via network but I get an SELinux violation when trying to connect using the socket. I believe the contexts ...
0 votes
0 answers
89 views

Apache2 with GSSAPI auth, can't exclude one location from auth

We have an apache2 serving a PHP application, with kerberos authentication We developed an API within the PHP application, and we want to access it without Kerberos auth But we cannot manage to ...

1
2 3 4 5
159