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

Failed opening 'analytics.php for inclusion

I know that this question has been asked and answered a lot, but is there a difference for my case? Because as you can see, my directory where my testing website is located is named like the subdomain ...
Erick Holz's user avatar
0 votes
0 answers
16 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; #...
Gerrit's user avatar
  • 1
0 votes
0 answers
26 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 ...
Erick Holz's user avatar
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 ...
Rene Veerman's user avatar
0 votes
1 answer
66 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 ...
scott80109's user avatar
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. ...
ᴍᴇʜᴏᴠ's user avatar
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 ...
Salman Khan's user avatar
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:...
NickSoft's user avatar
  • 288
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 ...
Mert Kale's user avatar
-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 ...
alexbn10's user avatar
0 votes
0 answers
71 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 ...
Menelaos pc's user avatar
-1 votes
1 answer
81 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 ...
Martin Mystik Jonáš's user avatar
0 votes
2 answers
88 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 ...
ᴍᴇʜᴏᴠ's user avatar
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 ...
Bryan Wright's user avatar
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 ...
Hugo Delsing's user avatar
0 votes
1 answer
195 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 ...
Pablo Vazquez Alvarado's user avatar
0 votes
1 answer
98 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 ...
RyanLe's user avatar
  • 1
1 vote
1 answer
130 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,513
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 ...
Thibault Richard's user avatar
1 vote
1 answer
255 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
  • 113
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 ...
Alex Tokarev's user avatar
0 votes
2 answers
200 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
95 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
94 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
125 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
47 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
138 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
79 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
659 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
517 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
188 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
245 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
68 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
979 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
41 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
1k 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
74 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
161 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
233 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
105 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
63 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
90 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
170 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
774 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
  • 69
0 votes
1 answer
314 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
193 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
  • 211
0 votes
1 answer
85 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
53 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
551 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
124 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

1
2 3 4 5
159