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
1 answer
6k views

How to install PHP Sodium on Ubuntu 22.04

I'm running a Google Cloud server running Ubuntu 22.04. It's a typical LAMP stack (PHP is version 8.1.2). Some of the websites on the server are using Laravel 8. I recently upgraded one of the ...
Adam's user avatar
  • 3
0 votes
1 answer
128 views

Apache not serving local hosts

I have set up an Apache Server on an a VMWare hosted Linux Mint 21 Server, I have followed the instructions at this blog to run multiple PHP versions (7.4 and 8.1). Apache is running fine and serving ...
deep64blue's user avatar
0 votes
0 answers
38 views

Two application installations from APS catalog fails on Plesk for Windows Server: The 'mysql' extension was not found

Please excuse, if this is the wrong place to post this question, I didn't know better. I'm using Windows Server 2022 and Plesk Obsidian Version 18.0.48. I try to install two applications via Plesk ...
Albrecht's user avatar
0 votes
3 answers
646 views

CGI scripts: when can you return a document, instead of an HTTP response?

Script 1 below is bash, and is at https://example.com/cgi-bin/test. It produces the output 'Under construction' when fetched. It echos Status and Content-type headers, and some HTML. If I instead try ...
QF0's user avatar
  • 183
0 votes
1 answer
417 views

Unable to connect to server following phpMyAdmin upgrade from 5.1 to 5.2

Not sure to post on the right StackExchange forum. If not, let me know! Working environment: OpenSUSE Leap 15.4 MariaDB : mariadb Ver 15.1 Distrib 10.7.7-MariaDB PHP 8.0.25 (cli) (built: Oct 31 2022 ...
wiltomap's user avatar
0 votes
1 answer
1k views

PHP8.1 FPM Crashes everyday after 12AM

From the last two to three days I noticed that my PHP8.1-FPM process crashes after around 12:00 AM-12:30 AM at night. My server has highest traffic in morning and lowest in night. But FPM process runs ...
Future King's user avatar
0 votes
2 answers
692 views

After setting up Apache it's not serving PHP files, but showing the contents of the files instead

The error I got is in this url: url in browser: http://localhost/ error in browser: https://justpaste.it/d82bd What am I missing here? I copied the file ipconfig.php (given below) from ipconfig.php....
Love Grover's user avatar
0 votes
1 answer
303 views

Error 502, phpinfo() directing to 7.4 when 8.1 is installed (File not found)

I'm setting up a web server. I have a freshly installed Ubuntu 22.04, Nginx (welcome page works), and php-fpm which installed php8.1 and php-fpm8.1. To test PHP, I created a /var/www//info.php which ...
Wiley Rush's user avatar
0 votes
2 answers
2k views

PHP8 ldap_bind : Error -1 Can't contact LDAP server

I m on almalinux 8.7 with PHP8. Test ldapsearch with TLS is ok ldapsearch -H ldap://xxxx -x -ZZ /etc/pki/tls/certs/xxxx.pem -D 'xxxxx' -w 'xxxx' -b 'cn=xxx,cn=users,dc=xxx,dc=xxxx' But ldap_bind won'...
Alex Lum's user avatar
  • 155
1 vote
0 answers
153 views

Change "Loaded Configuration File" for a specific domain [Not the entire server]

I do not want to make modifications to the default php.ini the server uses. I've made a new one to use, which is located in my site's own directory on an Nginx server. The issue I have come across is ...
omgsoblunt's user avatar
0 votes
0 answers
296 views

Parse HTML as PHP on a Azure App Service (Linux) running PHP 8.1

I am really struggling to get an Azure App Service running Linux and PHP 8 or 8.1 to parse HTML files through PHP. The 8.0 and 8.1 versions run on nginx rather than Apache. I have started by updating ...
Matt Doble's user avatar
0 votes
2 answers
5k views

Installing sql server drivers for php on ubuntu

Background I have an ubuntu server running laravel that needs to connect to a different server of ours running mssql. Linux server: Ubuntu 20.04 php 8.1 I created a laravel test query to help me ...
elb98rm's user avatar
  • 103
0 votes
0 answers
143 views

Php mail transmission error using postfix

I need your help I am using AWS and ubuntu os 20.04. The web server uses nginx and uses php mail I installed php 7.3 pfm. I used postfix for mail function and connected to SMTP. It's not Google, it's ...
EthanKyle's user avatar
1 vote
0 answers
501 views

index.php displays as listing on Apache2 server

My OS is Ubuntu 22.04 I started out by installing php 8.1 I then installed Apache/2.4.52 (Ubuntu) Server Then I added the following: sudo apt-get install -y php php-cli php-common php-mysql php-zip ...
EastsideDev's user avatar
1 vote
1 answer
286 views

keydb active-replica multi-master php session storage

I'm looking to use keydb/redis for php session storage in a HA setup. Currently, I have two keydb instances running with the following config: Instance 1 (192.168.2.10) requirepass pass123 masterauth ...
Aaron A's user avatar
  • 239
0 votes
1 answer
653 views

Issue with 'mkdir(): No space left on device" in Docker Container. Might be some other issue though?

I have some docker containers (NGINX / PHP, MySQL, etc.) that have been running fine for years. However, recently I started seeing this error when running a PHP script in Laravel in the NGINX / PHP ...
SScotti's user avatar
  • 141
0 votes
1 answer
196 views

Nginx Error after upgrading php

I have an aws server that runs some php code. I recently upgraded to php8. Now when I access php pages on my site (for example https://whitewaterwriters.com/oracle/index.php) I get a nginx error. I ...
Joe's user avatar
  • 131
0 votes
1 answer
2k views

php command not found after PHP8 install on OpenSUSE Leap 15.4

I have upgraded my OpenSUSE Leap from 15.3 to 15.4. I then want to upgrade PHP from version 7 to version 8. Before upgrade, PHP version is: server:~ # php -v PHP 7.4.33 (cli) (built: Nov 3 2022 12:00:...
wiltomap's user avatar
0 votes
1 answer
202 views

Modular Dependency in my Docker "dnf module enabled -y php:7.4 php-oci8"

So I'm running a command dnf module enabled -y php:7.4 php-oci8 but I'm getting a Modular Dependency Problem, this was not an issue before. Problem: module php-oci8:21c:8060020221011134100:34611983....
Vincent Dapiton's user avatar
0 votes
0 answers
271 views

IIS FastCGI configuration for high concurrency

I am hosting, on Windows Server 2022, a web application that makes regular ajax calls to a PHP backend. The calls themselves are quite light, just pulling and pushing data from and to a MySQL db. Over ...
resle's user avatar
  • 189
1 vote
1 answer
2k views

Why environment variable set by SetEnv in apache httpd.conf cannot be passed to php?

I set an environment variable in httpd.conf: SetEnv http_proxy "http://localhost:3128" But I cannot get this variable in php using getenv: <?php echo getenv("http_proxy"); ...
peter's user avatar
  • 103
1 vote
1 answer
733 views

How to configure a system wide proxy for php file_get_contents on CentOS?

I want to let the php file_get_content function connect to network via system-wide proxy. I tried to add the following lines in /etc/environment: http_proxy=http://localhost:3128/ HTTP_PROXY=http://...
peter's user avatar
  • 103
1 vote
1 answer
157 views

How can I locate the php script that issues outbound connections?

I have a server running httpd for several websites. Using the top command, I found many httpd processes exhaust memory. Using the netstat command, I found the httpd processes are connecting to an ...
peter's user avatar
  • 103
1 vote
1 answer
1k views

Nextcloud installation broken after upgrading to Ubuntu server 22.04

I'm currently running Nextcloud on Ubuntu server. After upgrading from 20.04 LTS to 22.04 LTS, I couldn't log into Nextcloud. I switched the PHP modules from 7.4 to 8.1 as recommended in this forum ...
David Chidester's user avatar
0 votes
0 answers
47 views

How to server index.php from different directory through .htaccess?

I am working on a project which is in Yii2. I have to integrate swagger UI for API documentation. My current directory structure: This is what the .htaccess looks like: RewriteEngine on RewriteCond %{...
Paresh Maheshwari's user avatar
0 votes
1 answer
3k views

How to properly setup composer within PHP Apache Docker Container

Content of my Dockerfile: FROM php:8.1-apache WORKDIR /var/www/html/ RUN pecl install xdebug \ && docker-php-ext-enable xdebug \ && a2enmod rewrite \ && docker-...
DevelJoe's user avatar
  • 187
0 votes
0 answers
100 views

server configured for SSL cert and is protected, php $_SERVER['HTTPS'] is not set

I've come across an issue I haven't seen before and am really scratching my head. We have a basic wordpress site running on a WHM/cpanel(for configuration) hosted platform. We have an SSL certificate ...
jeffro25's user avatar
0 votes
0 answers
352 views

Create ubuntu user with home folder located in www and restrict ssh access using ChrootDirectory to that folder

I posted this on stackoverflow and was told to post here: I am running a Ubuntu remote dev server, heavily restricted (due to compliance) environment which i previously had configured correctly for ...
user1529597's user avatar
0 votes
0 answers
209 views

Can't modify header Content-Type in PHP with Nginx

I have a nginx/1.18.0 and php-fpm 7.4.19 (fpm-fcgi) PHP code header('Content-Type: text/css',true) doesn't modify the header, the same for application/javascript or image/jpg, files are sent with ...
TeoD's user avatar
  • 1
-1 votes
1 answer
575 views

Deployment PHP with OpCache

How do you do deployment PHP applications with enabled OpCache? My situation: I have web server with PHP 7.4 and enabled OpCache. Server is common virtual 4vCPU + 8GB RAM. I use tool Deployer - ...
grogsy's user avatar
  • 99
0 votes
0 answers
377 views

PHP 8 on IIS 2019: Sometimes Session can not be written

From time to time I get the classic "Failed to read session data" error on my application running on php 8, IIS 2019. This is usually associated with a) the directory does not exist b) the ...
habsi's user avatar
  • 101
0 votes
1 answer
52 views

Is PHP's error_log dependent on the OS, config file or something else?

I have two HTTP servers: Live LAMP server. Local WAMP server. When an error occurs on the live server PHP will generate an error_log file in the directory of where the script error occurred. The ...
John's user avatar
  • 134
1 vote
1 answer
1k views

I get 404 error when trying interper PHP with Nginx in Docker

Sorry if this question is answered. It my first time using Docker in web dev. Im setting up Nginx - PHP - MariaDB for my projects . And get stuck when my Nginx show 404 error when everytime i access ...
Bùi Nguyễn Hoàng Thọ's user avatar
1 vote
1 answer
583 views

How to manage multiple environments for an app on Ubuntu with Apache server?

I have a PHP app and I would like to host staging, demo, and production servers from one instance on Linode. The challenge I am running into is loading different environment variables for each server. ...
Evan Appleby's user avatar
0 votes
1 answer
184 views

Fix virtualmin domains to use individual php ini files

My server is setup to use virtualmin for managing configurations. In trying to resolve a php issue when a wordpress plugin installation, I inadvertently broke the settings on my domains so they no ...
Mark's user avatar
  • 331
0 votes
0 answers
19 views

MySql not connecting after cloudfare integeration probably due to DNS Misconfiguration

I just added cloudfare to my website and website started showing weird errors after that which are automatically solved after refreshing the page 3-4 times. But after surfing the website, the same ...
Ahmed A's user avatar
0 votes
1 answer
164 views

browsers (librewolf & chromium tested) won't send if modified since & if none match after receiving one 304 not modified response

localhost development server : Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1j PHP/8.0.3 mod_perl/2.0.11 Perl/v5.32.1 I'm sending etag & last modified response headers with php : "Connection ...
mikakun's user avatar
  • 111
1 vote
1 answer
3k views

CentOS 7 - upgrade PHP version from 7.2 to 8

CentOS 7 Nginx Current websites run on PHP 7.2 PHP -v says ```# php -v PHP 8.0.25 (cli) (built: Oct 25 2022 09:42:31) ( NTS gcc x86_64 ) Copyright (c) The PHP Group``` But phpinfo() in the nginx ...
TheUnreal's user avatar
  • 119
0 votes
0 answers
133 views

How to disable request buffering in Apache2

I'm attempting to use PHP to show progress on uploads using apache2 (specifically 2.4.41 ubuntu). In the php manual here, it states: The web server's request buffering has to be disabled for this to ...
ActualExplosives's user avatar
0 votes
1 answer
87 views

PHP Serialize AWK command speed up?

I've built an SQL migration script that will replace text in a MySQL dump file. Replacements would be easy with sed, but we must account for special serializations (PHP Serialize). The code below ...
Richard Tyler Miles's user avatar
0 votes
0 answers
85 views

When is a new PHP-CGI process created?

My production server has been having a OOM issue. Upon investigating I find that a major memory eater is PHP-CGI processes. Each of my website, be it Joomla or Wordpress, is having 3 - 6 PHP-CGI ...
shenkwen's user avatar
  • 199
0 votes
1 answer
518 views

Best practices for PHP ini settings for large wordpress site?

I own a large wordpress site that gets 500k+ visitors 30+ plugins (some heavy) server with 128 GB RAM Wondering if there are "best practices" for php.ini settings for larger sites on Linux?...
user8749042's user avatar
-1 votes
1 answer
1k 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 ...
Singleton's user avatar
0 votes
1 answer
41 views

Keep GitLab environment running in Docker container

I'm aiming to deploy an environment for testing. It's a PHP application, and I could simply serve the PHP files using the embedded server. My .gitlab-ci.yml is plain simple: docker_test: stage: ...
Eduar's user avatar
  • 101
3 votes
0 answers
508 views

TCP retransmission inside of docker network

Just lately our server started experiencing increased CPU usage by the php(Symfony) and mysql processes. For quite some time we been trying to find the cause and we found out that we have big amount ...
Maarduk's user avatar
  • 133
0 votes
0 answers
454 views

CentOS7 Remi-PHP81 Followed steps. PHP command not found

Trying to install and enable PHP in a CentOS VPS. Found repository information from Remi's RPM Repository - Configuration wizard. Followed steps to install and enable PHP81. But php -v gives command ...
Vishnu's user avatar
  • 1
0 votes
0 answers
25 views

CentOS7 VPS: Install WordPress with existing MySQL and httpd

Requirement: Install Wordpress in CentOs 7 VPS Currently available: Apache : Server version: Apache/2.4.35 (IUS), Server built: Dec 8 2018 02:08:22 MySQL : mysql Ver 14.14 Distrib 5.6.47, for Linux (...
Vishnu's user avatar
  • 1
1 vote
0 answers
187 views

Monitoring php command line worker with Monit Ubuntu 20

Problems monitoring php script using pid method. We have a Laravel worker script that must be kept running on the server: php /data/git/site/directory/artisan queue:work --daemon when this is run on ...
sixfive's user avatar
  • 11
2 votes
0 answers
201 views

Webmail application (php) slow when consulting messages via IMAP. What to optimize to improve speed?

I have configured a couple of webmail applications (open source), to consult external email accounts (gmail). The applications are in Php and Mysql. Once installed, I can link my mail through IMAP. ...
Jhoedram's user avatar
  • 153
0 votes
1 answer
397 views

LAMP Stack - Multiple Websites Isolation

I would like to host multiple websites on a VPS (LAMP stack - Ubuntu 20.04 LTS). For security reasons, I'd like to properly isolate each website/vhost from each other and also prevent access to other/...
Tando's user avatar
  • 1