Skip to main content

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
252 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
344 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
72 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
2k 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
52 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
2k 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
87 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
265 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
335 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
110 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
65 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
96 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
213 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
1k 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
435 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
313 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
164 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
59 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
862 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
  • 133
0 votes
1 answer
152 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
153 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
284 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
50 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,461
-2 votes
1 answer
449 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
167 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
109 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
39 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
687 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
260 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
301 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
86 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
463 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
679 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
31 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
1k 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
649 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
336 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
472 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
467 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
104 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
  • 51
0 votes
1 answer
574 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
1k 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
89 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
47 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
381 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
225 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
430 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
545 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
244 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
131 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