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.

learn more… | top users | synonyms

6
votes
1answer
1k views

Nginx + PHP-FPM produce 502 bad gateway instead of fatal error?

I'm currently testing Symfony2 with Nginx and PHP-FPM. I also use Xdebug. Symfony2 comes with a Demo bundle, I wanted to test the new handling of fatal errors which comes with Symfony 2.2.0 by ...
6
votes
3answers
378 views

Memcached Lagging

Let me preface this by saying that this is a followup question to this topic. That was "solved" by switching from Solaris (SmartOS) to Ubuntu for the memcached server. Now we've multiplied load by ...
5
votes
2answers
5k views

Nginx ignoring client's HTTP 1.0 request and respond by HTTP 1.1

I am testing using nginx/php5-fpm, with the code <?php header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); // also tested: header("Status: 404 Not Found"); echo $_SERVER["SERVER_PROTOCOL"]; ...
5
votes
2answers
12k views

Php.ini disable “Scan this dir for additional .ini files”?

I want to lock my php configuration and disable loading other php configurations rather than the default (which in my case is located at /usr/local/php/lib/php.ini) I want to disable the "Scan this ...
5
votes
3answers
17k views

PHP: Serve a file for download without providing the direct link

I want to serve invoices for download. Currently I'm using a simple numbering scheme (invoice-01.pdf, invoice-02.pdf, and so on). I know that I could use hashes instead to obscure the data. Is it ...
5
votes
5answers
455 views

What should I do when I need one server more?

If I have a website hosted on linux server. Assuming the website uses PHP and MySQL database. If I needed one day to add another server in order to support the performance of the site, what should I ...
5
votes
7answers
17k views

Mac OS Snow Leopard: Why does my mysql.default_socket value not change in my phpinfo() page?

I'm getting errors whenever I try to connect locally to mySQL on Mac OS Snow Leopard 10.6.4. I'm running mySQL 5.1.46. I can log in using the console. I'm running PHP 5.3.2 and my phpinfo() page is ...
5
votes
7answers
12k views

What causes PHP pages to consistently download instead of running normally

I'm running a Ubuntu Server on a VM, to test out different web forum solutions. I have set up a ~/public_html/ to be accessible with the apache2 web server, and that works fine. However when I go to ...
5
votes
5answers
8k views

Is LDAP the only way to authenticate an web application against Active Directory?

I'm a PHP programmer and I've never work with active directory or ldap. I need to integrate my web app with an active directory and after ask the IT guy of the client company he said to me that isn't ...
5
votes
6answers
5k views

What is the best Linux distro for a php web server? [closed]

We are planning to upgrade our hardware and at the same time we plan to reinstall all our web server from a fresh OS. Currently our web server is running on CentOS 4.7 on a dedicated server. We are ...
5
votes
4answers
7k views

Do i need to open 25 port to send emails with the php mail function?

I have a Linux web app. Do I need to open port 25 to only send emails using the PHP mail function? If I have to open port 25, how can I disable receiving emails? Edit: I am asking because I ...
5
votes
8answers
4k views

Apache gets “clogged” with certain requests

I have a very odd intermittent issue. It occurs on a shared hosting server running CentOS and Apache/2.2.8, serving mostly PHP based websites at a rate of between 10 - 30 requests/sec. 3.5 GB RAM, ...
5
votes
3answers
2k views

PHP as CGI or Apache Module?

I've always believed that PHP works better installed as an Apache module, but recently, someone on a local forum pointed out that running PHP as CGI is better security-wise. I've done some googling ...
5
votes
5answers
18k views

Installing PCNTL module for PHP without recompiling

Is it possible to install the pcntl module without recompiling php? I'm trying to set this up on CentOS.
5
votes
4answers
13k views

Are PHP session files ever deleted?

I see there are thousands of files in my "/tmp" directory (a CentOS machine) and almost all of them are PHP session files. I'm worried about the possible impact this might have on my system. Are those ...
5
votes
1answer
4k views

How do I decode this WordPress hack? [closed]

I found an offending string in a client's WordPress-powered website, and I just want to know what it does. @preg_replace("\x40\50\x2e\53\x29\100\x69\145","\x65\166\x61\154\x28\142\x61\163\x65\66\x34\...
5
votes
1answer
9k views

Nginx: Rewrite rule for subfolder

I have a subdomain where I want to keep projects I am working on, in order to show these projects to clients. Here is the configuraion file from /etc/nginx/sites-available/projects: server { ...
5
votes
8answers
3k views

How can I test if a website is infected with malware?

Some friends of mine have a website (www.kennelsoffie.dk) and I'm trying to help them when there is any trouble. However this time I, can't figure it out. When I visit the site using Google Chrome, I'...
5
votes
2answers
3k views

PHP install on clean Amazon Linux AMI

I'm trying to get a script working to bring up new Amazon Linux EC2 instances with php55 and the Amazon PHP sdk. However, I'm running into a problem that I think is caused by PHP version conflicts. I ...
5
votes
1answer
4k views

Trying to install pecl Solr extension but it needs curl

When I try to install solr-beta: pecl install solr-beta I get this error: pecl/solr requires PHP extension "curl" No valid packages found install failed The thing is curl is already installed and ...
5
votes
3answers
5k views

Speeding up Apache and PHP

What are some good modules or systems that for caching that I can use for decreasing my load on Apache on an EC2 server running PHP, and why would you choose them?
5
votes
3answers
2k views

Optimizing VPS Server Memory

WHAT I'M TRYING TO DO The server resource limits sometimes run tight; to help prevent memory exhaustion, I've had to limit server processes. I'm needing a little expert help to know if I'm on the ...
5
votes
1answer
8k views

Compiling PHP with LDAP support on Ubuntu 12.10

I am trying to compile PHP on Ubuntu 12.10 with LDAP support. I have run: apt-get install libldap2-dev That installs the header files to /usr/include. However, when attempting to compile it is ...
5
votes
1answer
9k views

How to install PECL on a linux system

There are download sections for PECL extensions in http://pecl.php.net/ But I am not getting install steps for PECL itself*. Following command does not work - yum intall pecl In my system, I have ...
5
votes
2answers
3k views

Graceful upgrade from php53u to php54

We are running a CentOS 6 node using iuscommunity repo, and want to upgrade previously installed php53u to php54. However, this introduces a dependency conflict between php53u & php54. Does ...
5
votes
2answers
18k views

How to upgrade to latest PHP, MySQL, and phpmyadmin on CentOS 5.8 (32bit)?

I have searched around on the internet and cannot find a reliable source for installing the latest versions of PHP, MySQL, and phpmyadmin on CentOS 5.8 32bit with apache. I have tried a couple times, ...
5
votes
2answers
9k views

Change php modules directory

I am compiling php, and its setting my modules directory to /usr/lib64/20090626-zts I would like to change this to /usr/lib64/php/modules, but I cannot find a configuration option to do so. I can ...
5
votes
3answers
4k views

PHP APC installation questions

While installing PHP APC, I received two unexpected questions. I had previously installed APC at a test environment and did not receive these questions. The questions are: Enable per request ...
5
votes
5answers
3k views

Apache on Windows in production environment? Why not?

"Everyone" know that Apache is for Linux/Unix and on Windows IIS is the way to go. However, I'm not a pro at Linux and it would be an enormous relief for me to use just the same setup in the ...
5
votes
1answer
2k views

/usr/bin/host executed by hacked PHP script

Today I noticed unusual high request rate on Apache webserver and also quite high incoming network traffic. Upon checking Apache's mod_status page, I found the offending URLs to be from path www....
5
votes
1answer
6k views

Unable to set php_value in .htaccess file

I am trying to set up NewRelic on my Apache2/PHP server, and have it report different applications per vhost. To do this, the php value newrelic.appname must be changed. It is defined by default in /...
5
votes
1answer
7k views

Problems installing PHP libevent PECL Package

On my Ubuntu 11.04 development machine I have PHP installed (via aptitude). I want to experiment with the libevent PHP extension but I can't seem to get it working: root@alix-laptop:~# pecl install ...
5
votes
3answers
12k views

run shell command as other user called by PHP

I have a PHP script which is called by HTTP and not as command line script. This script should call a shell command as an other user than the current webserver user www-data. Example: <?php echo ...
5
votes
5answers
6k views

Adding PNG & JPG support to ImageMagick in PHP on CentOS

I have installed the ImageMagick extension for PHP on CentOS, but it does not have support for PNG or JPG, how do I add support for these file types to ImageMagick?
5
votes
5answers
7k views

How to secure a directory in Apache using a PHP session

I have a site that uses PHP session for authentication. There is one directory that I would like to restrict access to that does not use any PHP, it's just full of static content. I just don't know ...
5
votes
8answers
2k views

Hanging page loads every n loads

I recently moved my site to a new server (Apache 2, PHP5, MySQL5). The site is an Invision based forum. Every few posts / topics it just hangs. The data has been written because if you stop and reload,...
5
votes
2answers
32k views

PHP/Apache POST limit?

I'm trying to edit large (200KB or so) articles on my MediaWiki install, but doing so gives me this error: Request Entity Too Large The requested resource /path/to/my/wiki/index.php ...
5
votes
5answers
16k views

show php error message on IIS 7

I am using IIS as a webserver on my development machine for PHP webdevelopment. Or at least, I am trying to. When there is a syntax error in a PHP script and I open that file in my webbrowser, I ...
5
votes
1answer
5k views

Upgrading from php 5.3 to php 5.4 with Macport

PHP5.4 has been available for sometime now and Macport recently caught up with the release of port php54 but the process of upgrading is not as clear as possible. Even worst for those who are new to ...
5
votes
5answers
6k views

Running git pull from a php script

I was trying the Perfect Workflow, with Git, GitHub, and SSH, but it seems i can't run git pull. I've tried git status and it's fine. When i git pull 2>&1 i get: error: cannot open .git/...
5
votes
1answer
4k views

Mixed IP and Name Based Virtual Hosts with nginx

I set up many domains but I dont know how to configure if only ip address is given. say foo.com I have a setup to go web/foo.com/htdocs, I want to 88.99.66.55 ip address like a domain to web/fook....
5
votes
3answers
8k views

Configuring php mail() per domain

I have about 6 sites on my dedicated server (running centos5), and all emails sent using php's mail function are sent by nobody@servername.hostname.com e.g. "Received: from nobody by servername....
5
votes
1answer
5k views

How To Change What Version of PHP Apache2 Uses?

Ubuntu 10.04, MySQL 5.1, Apache 2.2, and PHP 5.2/5.3: I just discovered that I am using the wrong version of PHP for a CRM application. Once I figured out how to make a simple phpinfo() script to ...
5
votes
2answers
182 views

Re-compiling PHP

Say I compiled and installed PHP and then I wanted to add an additional extention a few months later. Do I need to specify everything I've included during my initial installation along w/ the new ...
5
votes
2answers
3k views

A single php-fastcgi process blocks all other PHP requests

I've recently switched to a FastCGI setup for PHP (Apache2-worker and mod_fcgid). However, when a single PHP script is very busy, it seems to block all other PHP requests. What would be wrong with my ...
5
votes
2answers
8k views

How to detect in PHP, if it is running on Apache, Nginx or some other webserver?

First I know this variable : _SERVER["SERVER_SOFTWARE"] In one of my application, I want to check from PHP script which webserver it is running on. Basically it will be a wordpress plugin which will ...
5
votes
1answer
62 views

What do I download to get a Apache 2.0.x + PHP 4.4.x environment?

What do I download (on a windows box) to get a Apache 2.0.55 + PHP 4.4.7 environment? I am fine with newer versions of PHP and Apache, but if I want to emulate a environment on an old SunOS server ...
5
votes
4answers
10k views

PHP date.timezone warning

I keep getting this error: Message: date() [function.date]: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the ...
5
votes
2answers
844 views

What is causing the limit of 300 connections per second in Apache 2.2?

We have an Apache webserver running on CentOS 5.6 (installed via yum). Today we have had an expected influx of new users -- however unexpectedly we seem to have hit a limit of 300 accesses per second -...
5
votes
5answers
921 views

One Wordpress install (multisite) or multiple installs?

I manage a server for a client who has several Wordpress blogs. They all precariously balance on PHP/FastCGI/nginx and it all works at the moment, just using a little more RAM than I'd normally be ...