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
1 answer
52 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, ...
Will Martin's user avatar
  • 2,503
0 votes
0 answers
31 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 ...
Thibault Richard's user avatar
1 vote
1 answer
105 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 / ...
b126's user avatar
  • 111
1 vote
0 answers
61 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 ...
Alex Tokarev's user avatar
0 votes
2 answers
108 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 ...
Chronocide's user avatar
0 votes
1 answer
65 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 ...
Łukasz Korona's user avatar
0 votes
0 answers
27 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 ...
Wad's user avatar
  • 1
0 votes
0 answers
59 views

Two Virtual Hosts with to disntinct PHP configurations via PHP-FPM on Ubuntu and Apache

I have to Virtual Hosts on Ubuntu 20.04. One host is test instance and one is production (I know it would be better to have it separate). Now I need to run different php config for test vhost than for ...
Łukasz Korona's user avatar
0 votes
0 answers
18 views

Ubuntu Apache2 mod headers - not adding

I have an ubunutu server with apache2 server and I need to add a custom header to every request. This seems very straightforward, but it's not adding the header. I have enabled the module headers with ...
Hugo Delsing's user avatar
-2 votes
3 answers
82 views

Running a website on a LAN only

This is a big question, so I'm only looking for a high-level overview answer to help me research the bits I don't know. Essentially the problem is this: I need to take a dedicated Mac Mini (or similar ...
Django Reinhardt's user avatar
0 votes
0 answers
53 views

PHP PEAR Mail STARTTLS failed error 220 with postfix

I'm running postfix with dovecot. I'm trying to use the PHP Pear Mail package to send e-mails, but I can't get it to work. The error I get is this: authentication failure [SMTP: STARTTLS failed (code: ...
Aviation4001's user avatar
0 votes
2 answers
335 views

How to force a server to return my IP address in IPv4 and not IPv6?

Scenario I have a tiny PHP script on a server that echoes the IP address of any client reaching it so the address can be added to the cpanel MySQL remote hosts table via the API. I call this script ...
user2834566's user avatar
0 votes
1 answer
260 views

Module mpm_prefork is enabled - cannot proceed due to conflicts. It needs to be disabled first

We've configured a Dockerfile containing the following code snippet: ############################################# #### Image containing compiled libraries #### ####################################...
IT-Girl's user avatar
  • 143
0 votes
1 answer
130 views

Connecting to Oracle Autonomous Database with PHP and OCI8

I'm using Oracle Cloud Infrastructure. I have a VM instance with Ubuntu-22.04-Minimal. Apache, PHP, and OCI8 are all installed and working. When I try to connect to the database I get: Warning: ...
Harley's user avatar
  • 101
0 votes
1 answer
170 views

PHP curl_init(), curl_exec() work from the command line but fail when browsed/accessed from a webserver

The following PHP script (when not anonymized) runs successfully at the commandline. It uses curl_init() and curl_exec() to retrieve JSON-formatted data, converts the result into an associative array, ...
Clovis_Sangrail's user avatar
0 votes
0 answers
57 views

Apache custom rewrite rule, using code

I would like to have Apache handle some custom URL rewrite code that I have. This code rewrites the following urls: https://www.example.com/request?data=SOMEDATABLOB into urls pointing to PHP pages. ...
andynewman's user avatar
0 votes
2 answers
569 views

High PHP-FPM CPU load (Laravel, Nginx, PHP 8.2)

The server I am running has 4 vCPU's, 14GB of RAM, 250GB Storage. I get on a 1 minute interval average over a working day (7 hours) around 400-500 requests per minute. I have increased the php-fpm ...
Jaquarh's user avatar
  • 191
0 votes
0 answers
23 views

Why can't intl.so find libicu?

On macOS 13.6 (Ventura) I have ICU installed in /usr/local and configured PHP with --prefix=/usr/local/php8x (for php80, php81, and so on). The configure script has no problem finding libicu, but at ...
Tim's user avatar
  • 594
1 vote
3 answers
623 views

Enabling gd extension in PHP for wordpress deployment

My Wordpress site was warning me that: Error The required module, gd, is not installed, or has been disabled. I started looking into this and found that it is disabled by default in php.ini: ;...
ingh.am's user avatar
  • 283
0 votes
0 answers
67 views

NGINX + Wordpress Config: Install Wordpress under subfolder but with a separate root?

I have a problem which I came close to solving but last step failed me. I have a WP install at www.example.com on Ubuntu/Nginx I have no issues there, I also wanted to have another installation for ...
yucelm's user avatar
  • 1
1 vote
1 answer
88 views

Is there a tool like ClamAV to scan PHP and JS files?

We're offering a shared web hosting service, where many websites live on the same server. Since a lot of people don't update their stuff, they get pirated all the time. Now, the websites are ...
leftcursor's user avatar
0 votes
0 answers
119 views

Error using nonce in .htaccess Content-Security-Policy (CSP)

I am attempting to use Content-Security-Policy nonce and its generating an error. The Error via console.log: Refused to apply inline style because it violates the following Content Security Policy ...
user avatar
0 votes
0 answers
102 views

comparing __FILE__ with $_SERVER['SCRIPT_FILENAME'] before sending header

I am new to PHP, I saw a code which has the following lines, what is the code trying to de here. if (basename(__FILE__) === basename($_SERVER['SCRIPT_FILENAME'])) { header("Location: https://...
Abdulrahman Hocaoglu's user avatar
0 votes
1 answer
61 views

Prevent a user with a valid session to directly access a json feed

I am using fullcalendar to fetch a json feed (https://fullcalendar.io/docs/events-json-feed). <script> var calendar = new Calendar(calendarEl, { events: '/myfeed.php' }); </script> ...
2WFR's user avatar
  • 135
0 votes
1 answer
82 views

Very low resource usage on Openlitespeed (LOMP) on Ubuntu 22.04

I have been testing a custom PHP script on LOMP (Ubuntu 22.04) running on VirtualBox (2GB/2Core). First, I tried Apache and upon benchmarking the script, it could complete 10K requests in ~36s - ab ...
Noob YT's user avatar
0 votes
1 answer
133 views

Apache + PHP with mod_php No timeout

I am actually working on Apache server 2.4 with PHP 8.2 (mod_php) & debian 11.2 Recently I sent a HTTP Request with more than 100 seconds without a timeout. This request executed a large MySQL ...
2Max's user avatar
  • 101
0 votes
1 answer
593 views

PHP openssl encryption aes-256-cbc and decryption using NODEJS

I have a PHP script used to encrypt data with openssl_encrypt() and the aes-256-cbc algo. Encryption/Decryption works well using PHP, it's an old script. I've been trying to decrypt the datas using ...
Givre's user avatar
  • 59
0 votes
1 answer
242 views

http_code 0 with Redhat php curl request

I can use lynx to access a website from the server fine. When I try to access the same website with a php curl instruction I get http_code=>0 from curl_getinfo($ch); The same php code on another ...
CSchwarz's user avatar
  • 101
0 votes
1 answer
112 views

Laravel app routes not working when using domain name (fine with IP address) on AWS Lightsail

I am running a Laravel 10.x application on an Amazon Lightsail server here - 18.134.48.92 Currently when browsing to http://18.134.48.92/login I am correctly shown the login page (I am using Laravel ...
Zabs's user avatar
  • 201
0 votes
1 answer
55 views

Need equivalent .htaccess rule in apache just like nginx so I can get everything in URL

I have a VPS where I am using nginx and uses following to do URL rewriting. location / { try_files $uri $uri/ /index.php?$args; } Then I simply go to index.php and use the following code to get ...
Frank Martin's user avatar
0 votes
0 answers
49 views

clamdscan returns "Clamav Daemon cannot be started" but clamd is running

I am using clamdscan to scan files uploaded to a website. If I run clamdscan from the command line it works fine. However, if I call from a PHP script it throws an exception: App\Util\Exception\...
williamsdb's user avatar
0 votes
2 answers
383 views

Missing php8.0-fpm sock file

I'm using Ubuntu 18.04.6 LTS and I used the following commands to install php8.0 sudo add-apt-repository ppa:sergey-dryabzhinsky/php80 sudo apt-get install php8 after running php -v it's running the ...
Ian Arman's user avatar
  • 123
0 votes
1 answer
107 views

PHP mail.add_x_header not showing in log

On Ubuntu 22.04 I have the following in /etc/php/8.1/apache2/php.ini (and have restarted Apache), and in /etc/php/8.1/cli/php.ini: ; Add X-PHP-Originating-Script: that will include uid of the script ...
TommyPeanuts's user avatar
0 votes
0 answers
106 views

Limit php-fpm to a specific sub directory generally handled by apache

I am facing the following legacy setup with php-7.4 and libapache2-mod-php7.4 installed and enabled: <VirtualHost *:80> ServerName example.com DocumentRoot /var/www/html <...
Cologne_Muc's user avatar
0 votes
0 answers
192 views

Permission issues in docker + laravel

I've been having this problem for a week and I don't know how to solve it. I started a small laravel project with Docker and Docker's mysql doesn't work at all. It keeps crashing by itself, when ...
Sapinn's user avatar
  • 1
0 votes
0 answers
32 views

Apache - How to compress (gzip) only specific calls

I have PHP application served with Apache 2.4 I need the apache to compress (mod_deflate - gzip) calls for specific users. So the application should decides dynamically which calls gets gzipped. I was ...
Niro's user avatar
  • 1,451
-2 votes
1 answer
261 views

Unable to move uploaded files with php (Apache 2.4) - Permission denied

In my project I can't use move_uploaded_file PHP function because of: Notice: PHP Request Startup: file created in the system's temporary directory in Unknown on line 0 Warning: move_uploaded_file(.....
MHSarmadi's user avatar
0 votes
1 answer
115 views

installed homebrew openssl library not found when building MongoDb PHP driver on Mac

Similar to this questioner, due to a 502 Bad Gateway error, following the PHP docs I am attempting to build the PHP Mongo driver from scratch, using a modified ./config step ./configure --with-mongodb-...
wonder95's user avatar
  • 123
0 votes
1 answer
69 views

Track down PHP crash running in lighttpd - no logs

0 Just recently I've started to see seemingly random crashes on a web server that has been stable for quite some time. I think PHP is crashing, but there are no crash logs so I'm only assuming that's ...
QldRobbo's user avatar
0 votes
0 answers
34 views

All .PHP pages give 5x error in nginx

I followed this guide to install Nginx and PHP on a CentOS server. I am able to do things like php --version and even use the interactive shell. But inside of /usr/share/nginx/html/, I make a PHP file ...
super15's user avatar
1 vote
1 answer
373 views

How to enable executing php files in Fedora Apache?

I installed httpd and php v8.2.11 on my Linux Fedora. But Apache can't execute .php files. (Responses "Access denied.") I tried to use chmod shell command to enable executing and add AddType ...
MHSarmadi's user avatar
0 votes
0 answers
145 views

SELinux silently blocking PHP process listing

I have a system where we use PHP to run some rudimentary health checks on the server. When hitting a status page, it verifies that certain processes are running, and returns an error message if ...
Jared's user avatar
  • 383
0 votes
0 answers
179 views

php-fpm - How to log `NOTICE`s to stdout, everything else (`E_ALL`) to stderr?

As far as I understood the configuration docs, it is only possible to enable/disable specific log levels: # ini, E_NOTICE disabled entirely. error_reporting=E_ALL & ~E_NOTICE display_errors=stderr ...
goulashsoup's user avatar
1 vote
1 answer
81 views

Backup server for several servers with yesterday's files

There are several servers under CentOS with PHP projects, and the task is to make a server (or servers) for them to store yesterday's versions of uncompressed files of all projects from all servers, ...
Dmitry's user avatar
  • 33
1 vote
1 answer
261 views

/usr/lib/apache2/modules/libphp5.6.so is missing on Ubuntu 18

I installed PHP 5.6 with: apt install php5.6 Then I added a -s link in /etc/apache2/mods-enabled for php5.6.conf and php5.6.load When I restarted apache2 I got this error that wasn't there before: ...
PHP Guru's user avatar
  • 121
1 vote
2 answers
270 views

Updated upload_max_filesize and post_max_size in php.ini but still cant upload large files

I am using a Laravel based app on Ubuntu 22.04, Nginx, php8.2-fpm. I have deployed the same app on 2 other servers but they use Ubuntu 20.04 and php8.1-fpm. In each case I updated the php.ini of both ...
andygozindy's user avatar
0 votes
0 answers
24 views

What's the ODBC SparkSQL Source Format for Connecting with PHP ODBC & Spark?

What's the ODBC SparkSQL Source Format for Connecting with PHP ODBC & Spark? Here's the code I need to edit: $conn = odbc_pconnect("CData ODBC SparkSQL Source","user","...
Neo's user avatar
  • 1
0 votes
2 answers
447 views

How to switch PHP versions in Nginx if fastcgi_pass is pointing to a TCP socket

My question is simple (I hope). Everywhere on the internet I read that if I want to change PHP versions in Nginx, I need to change the UNIX socket of the fastcgi_pass parameter. But my fastcgi_pass ...
Daan van den Bergh's user avatar
0 votes
1 answer
273 views

502 Bad Gateway nginx 1.20.1

I know why is this coming. But I don't know how to fix it. I was installing osticket following this article. https://www.vultr.com/docs/how-to-install-osticket-on-centos-7/ Turns out current osticket ...
achhainsan's user avatar
2 votes
0 answers
283 views

Docker nginx + php performance

I am using docker-compose to run an nginx container and a PHP container. I have a performance issue, where each 4th or 5th request to a simple PHP script takes several seconds (normally <<1s). I ...
Joaquim d'Souza's user avatar

1
2 3 4 5
159