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

Configuring NGINX to emulate API in PHP

I am trying to emulate an API path to reroute to a PHP script. I'm trying the following configuration (found here), but receiving a 404. location ~ ^/api/v1/(.*)/?$ { try_files $uri $uri/ /v1/...
Kermit's user avatar
  • 71
1 vote
1 answer
23 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
-1 votes
0 answers
153 views

Browser NS_ERROR_NET_RESET [closed]

I have two boxes: A: IIS 8.5.9600 on Windows Server 2012 R2 B: IIS 8.0.9200 on Windows Server 2012 php version is the same: 7.4.13 when a simple php script in box A outputs more than 4MB I get in the ...
MirrorMirror's user avatar
0 votes
0 answers
37 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
97 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
54 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
53 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
44 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
130 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
149 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
24 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
24 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
34 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
83 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
42 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
45 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
61 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
21 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,441
-2 votes
1 answer
97 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
59 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
0 answers
31 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
33 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
155 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
73 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
66 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
74 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
114 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
  • 111
1 vote
1 answer
99 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
21 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
167 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
128 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
167 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 vote
1 answer
112 views

How to serve php files from a folder outside of web root folder in nginx

When i go to url www.example.gr i want to load a form where i will be able to submit it to www.example.gr/php/mail.php. My files and folders structure is like this root folder ( /var/www/html/app/ ) ...
chris tsironis's user avatar
0 votes
1 answer
182 views

htaccess rewrite rule to a specific PHP page doesn't work

I have the following code in my .htaccess file, placed in the root of my Ubuntu 22.04 instance: Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...
Frank Eno's user avatar
  • 101
0 votes
0 answers
26 views

spawn process from php in windows that does not wait for command to complete

How can i spawn a process from PHP 5.6.40 running on Windows IIS7 that returns immediately ? I've tried the following but it waits for the command to complete : exec("start ping -n 3 127.0.0.1 &...
Barny's user avatar
  • 23
0 votes
1 answer
164 views

PHP Fatal Error: Cannot open /dev/urandom: No such file or directory when calling session_start() with manually built PHP

Problem I built PHP8.4 manually in Ubuntu 14.04 since the OS is out of support with no ppa package available. I tested for phpinfo() web page showed correct information while adding session_start() at ...
NeNe's user avatar
  • 3
0 votes
0 answers
585 views

[Microsoft][ODBC Driver 17 for SQL Server] SSL Provider: [error:0A000102:SSL routines::unsupported protocol] in PHP Laravel on macOS using Brew

I'm encountering an issue while trying to connect to a SQL Server database using PHP Laravel on macOS with Brew. I'm receiving the following error message: [Microsoft][ODBC Driver 17 for SQL Server] ...
Ainz Ooal Gown's user avatar
0 votes
1 answer
40 views

PHP reinfect issue, creates random php and dot files [duplicate]

We are using a godaddy shared hosting package and running a few wordpress sites on this shared space. of late wordfence scanner detected malicious files within wp-includes and wp-content. Also some of ...
Desper's user avatar
  • 1
0 votes
0 answers
26 views

Installing PHP 7.3 on RHEL 7 - Angular/PHP files don't process

I've been tasked with setting up an old application on a RHEL 7 server. It has an Angular front-end (I'm unsure of the version, but it's old) with a PHP backend. However, in the browser console I can ...
DysonC's user avatar
  • 1
0 votes
1 answer
145 views

503 Service Unavailable or Empty Response on specific pages over PHP (PHP-FPM) on MacOS

I've got a strange problem here involving some versions of PHP installed in my local machine (MacOS Ventura 13.5). Certain pages (two at this moment) doesn't load in some versions of PHP. It's loads ...
Luiz Otávio's user avatar
0 votes
0 answers
109 views

Laravel: Logging messages generated by "error_log(...)" to terminal, while running app in Apache server

The issue is this one: When I run a Laravel app from PHP server, that's it, with php artisan serve, I could see every message generated by "error_log(...)" printed in the terminal, like this:...
Leandro Caplan's user avatar
0 votes
0 answers
185 views

Cannot connect to LDAP server ERRNO=0

I have a php application (apache,redhat with selinux disabled) and I am struggling with ldap configuration. I am trying to connect to a ldap server and I am getting this error in apache logs: ...
el sparrow's user avatar
0 votes
0 answers
211 views

SOAP-ERROR: failed to load external entity - cURL: connection refused

I run my server with ubuntu 18.4 with openlitespeed installed, i'm making some php code to call a web service with SOAP, however, on my production server i'm facing some issues: There is the code i ...
squarefighter's user avatar
0 votes
0 answers
152 views

My PHP sites do not work with mysql router

I recently set up a mysql innodb cluster, and have configured mysqlrouter to sit in front of it. On my PHP applications, if I change the port from 3306 to 6446, the application hangs when it tries to ...
elyograg's user avatar
  • 249
0 votes
0 answers
50 views

MacOS MySQL Client Gets Stuck on Query That is a Certain Size

My MySQL client gets stuck on a query when the output is a certain size. When it's small enough, the query will successfully output. The client is connecting to a remote server (Ubuntu 18.04). When I ...
Grant Gordinier's user avatar
0 votes
0 answers
28 views

NGINX- different web paths to different folders

I need to redirect different web paths to different folders on server. http://test.local/site1/ => /srv/site_1/src/public http://test.local/site2/ => /srv/site_2 tried such config, but it does ...
holden321's user avatar
  • 117
0 votes
1 answer
99 views

Running php and django on two subdomains

My friends and I have made a project which is made out of two parts. One is made in Django and other one is made in php language. We have just one server so we want to use 2 subdomains. My question is ...
Mehan Alavi's user avatar
0 votes
1 answer
221 views

Issue with Web Server running PHP thru Reverse Proxy

I'm using an NGINX reverse proxy, with wild card certs installed on the reverse proxy. Routing the NGINX reverse proxy traffic to standard web servers that are running Apache2 and NGINX Web services ...
Surfingjoe's user avatar
-3 votes
2 answers
96 views

Creating/Configuring a DNS server with runtime configuration [closed]

I have a big Windows video/audio application that may be controlled remotely over a web server. For that, I can listen to a local port in a, say, 192.168.1.10 system to port 8000, forward the port via ...
Michael Chourdakis's user avatar
0 votes
0 answers
48 views

system load spikes causing php-fpm pools to fill and cause micro outages

kind of at my wits end at this point and looking for some help. 2 physical Web servers CentOS NGINX PHP5 php-fpm 2 physical DB Servers CentOS NGINX elastic search zookeeper couchbase as user load ...
John Bell's user avatar

1
2 3 4 5
159