Questions tagged [php]
PHP is a widely-used general-purpose scripting language that is especially suited for Web development. Questions about programming in PHP are off-topic and should be asked on Stack Overflow.
1,994
questions
0
votes
1
answer
12
views
How to fix Apache PHP rejecting post requests which are over 40MBs
My php Laravel API when put behind apache2 (with ssl) when making a post request which is roughly 40Mbs in size, it gives a 500 internal error with following log
[Wed Jul 10 21:08:51.397912 2024] [...
0
votes
0
answers
19
views
Ubuntu 20.04: php lacking permissions to access /var/www/html
I'm trying to write contents to file, however I constantly receive error about lacking permission.
fopen(/var/www/html/files/l.log) Failed to open stream permission denied in /var/www/html/files/file....
0
votes
0
answers
43
views
How to adjust PHP FastCGI performance to the system resources (number of CPU cores mostly)?
We have a fairly weak server - 2 cores of Xeon Gold 6132.
Until recently the server didn't have much traffic but now we added a web page that generates more traffic than usual.
This is the number of ...
0
votes
0
answers
71
views
How to block IPs behind a web server?
I have a service in my page (hosted behind an Oracle server) that is being attacked by specific IPs. I see this in the Apache logs:
201.17.83.xxx, 201.17.83.xxx 10.0.1.xxx - - [14/Jun/2024:10:46:58 -...
0
votes
1
answer
21
views
Ngnix returns 504 while processing another request with php-fpm
Here is a simplified version of the page that causes me great trouble:
<?php
passthru('dd if=/path/to/file bs=xx skip=xx count=xx | resource_intensive_command | dd bs=xx skip=xx count=xx');
?>
...
1
vote
1
answer
77
views
ISPconfig/Nginx/wordpress to nginx proxy manager | wordpress using permalinks/postname
I am migrating my wordpress site from Ispconfig/Apache to Ispconfig/Nginx and introducing Nginx proxy manager in the mix. The problem seems to be the following:
htaccess is not enabled in nginx
are ...
1
vote
0
answers
97
views
how to install memcached via pecl?
I'm trying to install memcached and am having some difficulty. Here's what I tried:
apt-get update
apt-get install memcached libmemcached-dev libzip-dev
pecl install memcached
pecl install memcached ...
0
votes
0
answers
37
views
Is there a way to prevent direct copy of URL with X-Accel?
I am currently serving private images using X-Accel.
The images folder is behind the root, and I have the following block inside the nginx config:
location /private_files {
internal;
root /var/...
0
votes
1
answer
16
views
X-Accel return 404 but path and config seem to be correct
I have the following block in my nginx config:
location /files {
internal;
root /var/www/website/storage/uploads;
}
In my Laravel app I am trying to redirect get-file URI to the private ...
0
votes
0
answers
133
views
How to make a captive redirection portal for a SSID?
I have a PHP project running on one of my computers connected to my home network, I access the project from the same computer by localhost/myserver and by my other devices connected to the same ...
0
votes
0
answers
54
views
Creating a Chrome bookmark to automate a web PHP search
I am an user in some forum, and I want to create a bookmark for searching my past messages. To do so, you can open an advanced search link whose address is as follows (identifiable words have been ...
0
votes
0
answers
34
views
How can I prevent Thunderbird from deleting mail that is "too large", after I click to allow the download?
I exclusively use Thunderbird in POP mail mode. I'm mainly concerned with attachments sent from mail forms on my own websites, sent to email addresses which are also from my own domain. So I have ...
0
votes
0
answers
29
views
No input file specified with apache configuration php-fpm redhat
I have a php 8 installation (php-fpm) with apache on a redhat server. The apache configuration contains this rule for php files in the virtualhost:
ProxyPassMatch ^(..php.)$ fcgi://X.X.X.X
The php-...
1
vote
2
answers
645
views
Trying to make BLOB to PDF in browser using PHP [closed]
I have BLOB information from my database and trying to display a PDF file in browser using this:
echo "<object data='data:application/pdf;base64,".base64_encode($row['PDF_File'])."' ...
2
votes
1
answer
47
views
Replace text surrounding a wildcard in Notepad++
So, many years ago when I started writing PHP code, I learned to format information sent from a form as such:
$_POST[itemnamehere];
Whether that was right or wrong at the time, it worked. However, ...
0
votes
0
answers
210
views
PHP-FPM on Apache log issue
I am having trouble finding the cause of my php-fpm process logging its error output to the same location as the script result.
I have an Apache server which passes requests to the php-fpm process ...
0
votes
0
answers
253
views
Nextcloud AIO - How to persist modifications to php.ini in a docker container that frequently reboots
I’m running the Nextcloud AIO docker container. This consists of a master container that then runs the other containers such as the apache, and sql server containers. With this working I want to ...
0
votes
1
answer
258
views
How to upgrade ICU on Debian 12 for PHP Intl?
Ever since running into this timezone related bug in PHP, I've been trying to solve it by updating the ICU system library.
On my Fedora 39 workstation, as of this writing, version 73.2 is installed (...
-1
votes
1
answer
97
views
passthru background process sudo multiple commands
Have problem running the command in background. Below is configuration of code.
1] Using php passthru running a command as a different user than current
2] The command has multiple commands to run ...
1
vote
0
answers
108
views
PHP 5.4 yum dependency issue on AWS Linux 2
I am running PHP 8.1 on AWS Linux 2. When I run yum updates I get the following error:
> Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.16-46.amzn2.0.3 ...
-1
votes
1
answer
96
views
Start .bat file via php
I'm using
system('START C:\[address]\refresh.bat');
but when I start this I get:
C:\[address]>git fetch
'git' is not recognized as an internal or external command,
operable program or batch file.
...
0
votes
2
answers
259
views
Running “php -f file.php” prints the file contents instead of executing it
I have new freshly installed Ubuntu Unity (23.10) OS, where I installed PHP.
Now I want to run a PHP file from the terminal, but instead of executing it, it just print it contents. (The PHP file is ...
0
votes
1
answer
227
views
Cron job does not execute according to time schedule
Consider the following cron job:
* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php
Now, according to this, the cron job must run every minute starting from 22h00 (...
0
votes
0
answers
30
views
Error while trying to create module page on MediaWiki
I tried to create a Module page on my MediaWiki but I've been getting the following error:
Lua error: Cannot create process: proc_open(/dev/null): failed to open stream: Operation not permitted
I'm ...
0
votes
1
answer
123
views
How recover php-fpm conf.d files?
I'm trying to upgrade PHP with php-fpm from 8.1 to 8.2.
By mistake, I've deleted the files inside /etc/php/8.2/fpm/conf.d
I've tried to restart php8.2-fpm and Apache2 server, re-install php-fpm, but ...
0
votes
1
answer
101
views
How to publish a php website privately so I can make tests?
I want to publish my website as http secure connection but I want to keep it private so only I can view it. I want to prepare and test its security before its official release.
Is there any service ...
0
votes
1
answer
134
views
php-fpm and nginx security isolation not working....or may be my understanding is not correct
I followed the following tutorial to do isolation of my two websites.
https://www.vultr.com/docs/use-php-fpm-pools-to-secure-multiple-web-sites/
Here is what I did:
Created two users and then ...
0
votes
1
answer
267
views
How to serve html and php from multiple folders under the same host in nginx?
I want to serve two folders with nginx: a folder with generated html files, and a folder with static html and php scripts, take this folder structure as an example:
├─/var/www
│ ├─generated
│ │ ├─...
2
votes
1
answer
521
views
Can I reload php.ini without stopping and starting IIS? [duplicate]
I have a few websites running with IIS 10 that use the same php.ini, and I now changed a value in the php.ini file which cannot be set via the ini_set() method in PHP.
Is there any way to reload the ...
0
votes
1
answer
511
views
Error Installing OCI8 on Ubuntu 23.10 PHP 8.2
I'm running Apache 2.4 on a Ubuntu 23.10 server with PHP 8.2 and I can't install the OCI8 extension in order to connect to Oracle.
I previously had a PHP 5.6 built from a makefile which I recently ...