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.

1,628 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
1answer
18k views

upstream prematurely closed connection while reading response header from upstream 502 Bad GateWay

nginx is killin me.. so right now I have 502 Bad Gateway. error log says: 2016/10/12 17:39:53 [info] 3023#0: *464 client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0....
6
votes
1answer
15k views

nginx recv() failed (104: Connection reset by peer) while reading response header from upstream

I have recently upgrade my magento from 1.5 to 1.9 and when ever I add a certain product to basket, I started to receive this error: 502 Bad Gateway There were no log entries in the var/log/ folder: ...
6
votes
2answers
2k views

All PHP sites stopped working on IIS7, internal server error 500

I installed multiple drupal 7 sites using the Web Platform Installer on Windows Server 2008. Until know they worked without any problems, but recently internal server error 500 started to show up (...
5
votes
1answer
671 views

Nginx + PHP maximum output limit

I have php 5.5 (fpm) and nginx 1.10 installed (gzip configured to 1). Running on ubuntu. When I am "echoing" a large output (over 2 mb), it stops abruptly at around 520 kb. But same program when I ...
5
votes
1answer
8k views

Error headers: ap_headers_output_filter() after putting cache header in htaccess file

Receiving error: [debug] mod_headers.c(663): headers: ap_headers_output_filter() after I included this within the htaccess file: # 6 DAYS <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"...
4
votes
1answer
731 views

HSTS header not being sent though rule is present and mod_headers is enabled

We enabled HSTS in httpd.conf in the Virtual Host handling port 443. We tried with and without the <IfModule mod_headers.c>: <IfModule mod_headers.c> Header set Strict-Transport-...
4
votes
0answers
132 views

SQL server and PHP restart

i have Apache/PHP running on a server running windows 7 with SQL server 2008 r2 running on windows Server 2008. When SQL is restarted Apache/php will no longer connect to SQL once it is back up ...
4
votes
2answers
2k views

Apache/PHP ldap stops working. Requires restart of apache

I currently have a setup where users log in to a website using LDAP credentials. It's all internal so I don't really care a ton about certificates. So, in my /etc/openldap/ldap.conf file I have ...
4
votes
2answers
9k views

OpenSSL connection Error called stream_socket_enable_crypto()

in my php coding i have following line which uses by SWIFT MAILER Class if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { return false; } however ...
4
votes
1answer
805 views

Absolute/relative file paths affecting server load?

I was told by my hosting provider's technical people that I should be using relative file paths (/home/index.php) instead of absolute paths (http://www.example.com/index.php) to "reduce server load". ...
4
votes
2answers
1k views

Best Practice for upgrading PHP On Production Systems

We Have two load balanced web servers running php 5.3. I've been asked by our dev team to upgrade php to 5.4 because they need certain functionality it will bring. The main issue is that 5.3 is the ...
4
votes
0answers
1k views

Strange Apache/PHP&Perl behavior—error (70007)

I’m dealing with a particular strange situation: I have two Linux machines, one with Scientific Linux (v4.8) and one with CentOS (v6.2). On the SL machine I have a XAMPP distribution with Apache 2.2.9,...
4
votes
1answer
1k views

php-fpm keeps locking up

For some reason, php-fpm keeps locking up and/or hanging. It works for a little while, and then it will randomly just 'hang' for a long time upon trying to load a webpage. There's absolutely nothing ...
4
votes
1answer
245 views

Problems restarting Apache - Curl related

I'm having a problem compiling LAMP, I have everything compiled and working, but when I try to restart apache I get the following error: seg fault or similar nasty error detected in the parent ...
4
votes
0answers
3k views

php-cgi.exe and/or php5.dll crashing - PHP 5.2.17, Win2k8 & IIS7

A specific part of my PHP script crashes randomly and I'm not sure why. The only difference on this page and the rest of the pages, is that I'm doing a PDO SQLSRV call. But 80% of the time there are ...
4
votes
1answer
157 views

Apache rewrite works under FreeBSD, not under CentOS

I have 5 production servers which are running FreeBSD 9.2, but we are planning on transitioning to CentOS. Because of this, I am attempting to set up some virtual machines to emulate our production ...
3
votes
1answer
1k views

Getting error when installing php in Centos 7.4 OPENSSL_1.0.2

I am trying for a couple of days to install php without any luck. The process which usually takes 2 minutes. I have CentOS 7.4.1708 and Apache 2.4.6. When I install php using yum install php and run ...
3
votes
1answer
349 views

Hosting multiple websites (Apache Virtual Hosts), Postfix settings for sending mail FROM those domains?

I am not sure that this was the right solution in the first place but I have Postfix up and running on my Ubuntu VPS with G-Suite using relayhost = [smtp.gmail.com]:587 Mail is delivering fine, ...
3
votes
0answers
426 views

php_value overrides with Apache using a front controller

I am trying to set specific server side value for virtual paths used to upload files. All my URLs are virtual and requested are dispatched by a front controller. I have the following config in my ...
3
votes
1answer
937 views

Apache using wrong version of PHP

I'm trying to downgrade PHP from 5.5 to 5.3 (not by choice). I thought I uninstalled php 5.5 by typing the following sudo apt-get remove "php*" I then installed php 5.3 by following these ...
3
votes
5answers
3k views

Rewrite rule for nginx (Opencart)

Opencart has this URL structure: http://example.com/index.php?route=common/home http://example.com/index.php?route=account/register http://example.com/index.php?route=checkout/cart http://example.com/...
3
votes
0answers
140 views

How to harden nginx vhosts (hosting WordPress) from other users in hacked WP installs

Overview: I have a dozen or so WP installs hosted on an Ubuntu 14.04 LTS, w/ PHP 5.5.9 & Nginx 1.4.6. MySQL runs on alternate node, not on public network. Goal: To have directories & files ...
3
votes
0answers
221 views

How to verify network quality before running important benchmarks?

I have multiple CentOS servers around the world. They all are running a PHP script that tests the latency of some services once per minute. The problem is that sometimes these servers have local ...
3
votes
0answers
737 views

Upgrade openssl in apache from source and set as default

I have upgraded the openssl from source to version OpenSSL 1.0.1s for Apache, which installed under /usr/local/ssl/bin/openssl, and change the symlink to point it into this new installation directory ...
3
votes
0answers
120 views

IIS server slows down with only a few tens of requests

I'm using IIS 7.5 with PHP and I'm having troubles with my application, it is VERY slow and it can take more than 30 seconds to respond sometimes. I believe this is due to some kind of queue of ...
3
votes
1answer
3k views

Send mail service start error

I installed sendmail on CentOS based on some tutorial. When I start sendmail, it showing sendmail failed error. Here the following command result: systemctl status sendmail sendmail.service - ...
3
votes
0answers
1k views

Why do I get an OpenSSL Error when connecting PHPMyAdmin through SSL?

I'm running PHP 5.6.11 on Apache 2.2 with OpenSSL 1.0.1 on Ubuntu 12. I've sucessfully setup SSL in Apache and MySQL. Now I want to set up a PHPMyAdmin and connect it through SSL. I don't really need ...
3
votes
0answers
663 views

LDAP over TLS fails to connect, Schannel Alert 48

I am trying to use PHP to edit users in active directory through LDAP. My test machine is using a simple WAMP setup and is NOT connected to the windows domain. This machine can connect to LDAP on the ...
3
votes
0answers
165 views

Tuning Amazon Linux worker tier

I have a worker tier that is using PHP process control (pcntl) functions to send multiple requests to the SNS service in parallel. My question is how best to tune MPM_PREFORK directives to get the ...
3
votes
0answers
519 views

VirtualDocumentRoot and ProxyPassMatch

I have the following Apache configuration: ServerName localhost UseCanonicalName Off LogLevel debug <VirtualHost *:8080> ServerName _default_ VirtualDocumentRoot /Users/alex/Sites/...
3
votes
0answers
459 views

HHVM RepoAuthoritative Unable to stat file

My magento installation is hosted on a VPS running CentOS, Nginx, MariaDB and HHVM, which works without any problem. However, I am now trying to pre-build the RepoAuthoritative file for my ...
3
votes
1answer
1k views

Enforce loading of php.ini files from current folder

My goal is to increase the maximum file size for uploads in WordPress. I have followed the steps on this SE answer and this tutorial (except the .htaccess part, because it's runnning nginx and AFAIK ...
3
votes
2answers
2k views

Relation between PHP-FPM settings and mpm_worker (Apache)

I've a site running Magento on the following setup: Apache 2.4 with mpm_worker PHP-FPM Total RAM in server: 14GB (10GB avilable to Apache/PHP) Each PHP-FPM process consumes approximately 80MB of RAM....
3
votes
1answer
105 views

Nginx directory post

THere is a piece of legacy code I'm working on, I can't alter where it POSTs to so I just need to figure a way around it. THe bit of Javascript makes a post as follows - POST /authentication/login/ ...
3
votes
1answer
746 views

Apache server returns 404 after timeout

Making multiple requests to the server causes a 404 error after about 40-60 seconds. I am using JavaScript to request: example.com/test/location. Apache has mod_rewrite enabled that maps this to the ...
3
votes
1answer
3k views

Maximum limit of filepointer in php reached and not changeable

I have a server with the current 5.3.x version installed. Since we are running a really simple and small server in php using sockets, that connects to a lot clients using sockets we need to raise the ...
3
votes
1answer
477 views

PHP not closing TCP CLOSE_WAIT on web server

My web server has a lot of apache tcp CLOSE_WAIT's stuck at poll(found through a backtrace in gdb), How do I debug what in php is causing my web server to not properly close connections?
3
votes
1answer
875 views

Allow only one request per ip and url

Using a htaccess file or sending special headers from php, is there any way to allow only one http request by ip and url? I mean, an user could make multiple request simultaneously, but not to the ...
3
votes
2answers
226 views

System Requirements of a write-heavy applications serving hundreds of requests per second

NOTE: I am a self-taught PHP developer who has little to none experience managing web and database servers. I am about to write a web-based attendance system for a very large userbase. I expect ...
3
votes
2answers
2k views

Apache's “OPTIONS * HTTP/1.0” running 100% CPU - Runaway httpd process

I have this recurring issue where an httpd processes will randomly start running at 100% CPU. Often other httpd processes will join in, and it will continue until I restart Apache. Oddly, the thing it'...
3
votes
0answers
538 views

PHP + ImageMagick Performance Issues

Good Day, I have two environments: OpenVZ VPS and Pentium 4 local dev machine. They have all packages installed the same way. ImageMagick is compiled from sources without OpenMP support. When I run ...
3
votes
0answers
121 views

Connection reset with duplicate query parameters

Is there anything that could cause a connection reset when duplicate query parameters are passed to a page? http://test/?test[]=1&test[]=2 Causes a connection reset http://test/?test[]=1 Works ...
3
votes
1answer
3k views

“Unable to initialize module” fileinfo php-pecl-Fileinfo.x86_64

I have a brand new server server that I am trying to get setup up. This is a 64 bit machine that I can not install "fileinfo" or "memcache". I have uninstalled these and reinstalled them using yum ...
3
votes
2answers
1k views

mod_headers not working for php + mod_fastcgi pages

I'm running PHP through mod_fastcgi & mod_suexec, and I added Header set X-UA-Compatible "IE=edge env=best-standards-support" to my .htaccess file. It works fine for static content, but the PHP ...
3
votes
1answer
14k views

Soap error - failed to load external entity

I have a PHP-script which uses SoapClient that connects to an API and runs methods. It works on all the different servers I have run it on previously but when I tried it on a server I get the error: ...
3
votes
2answers
1k views

What would cause a PHP app to segfault intermittently under load?

Posted this on stackoverflow but it seems more relevant over here... I'm doing some load testing (using jMeter) on a PHP app (it's a symfony app, if that matters). I've tested it under both apache/...
3
votes
1answer
1k views

Roundcube, upload fail

I have Roundcube installed on Ubuntu 14.04, using NGINX, with static IP, SpamAssassin, ClamAV . Sending/receiving email was fine including downloads, however cannot upload anything to send. ...
2
votes
0answers
31 views

Downloading fails at random for our users, need help figuring out what's wrong

We have a file sharing service where users can upload, share and download their files. We are using AWS S3 to store our files. We're facing an issue where small files download fine, but when files ...
2
votes
1answer
82 views

How to retain domain name in url - Configuring Virtual host in apache 2 with aws linux instance

I'm trying to configure virtual host in apache2 in ubuntu instance hosted with aws and successfully redirected the requests to the appropriate website. Further clicking on the links on the index ...
2
votes
0answers
121 views

CentOS phpMyAdmin connecting from external ip?

I'm trying to connect to phpMyAdmin which is running on my CentOS server from my pc with the following phpMyAdmin.conf: <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <...