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

4
votes
3answers
6k views

How to set the PHP Api Version for phpize

I'm upgrading php on my server but I'm running into a problem with phpize and compiling external modules. phpize -v reports: Configuring for: PHP Api Version: 20041225 Zend Module Api No: ...
4
votes
3answers
2k views

How to add Postgres support to PHP installed by Homebrew?

I have already installed and configured new version of PHP with Homebrew, including MySQL support and XDebug. That works fine. However, I need to install the support for PostgreSQL as well. How can I ...
4
votes
2answers
6k views

What to do after hitting the dreaded 256 max connections Apache Limit

After scratching my head trying to figure out why my site was responding so slowly even though the server resources are fine, I finally checked the Apache status and found: 78 requests/sec - 0.7 ...
4
votes
3answers
4k views

Chrome caching 302 redirects

I have a php script with is used to rotate banner images on a site. Under Firefox/IE page refreshes will make another request and a different image will be returned. Under Chrome, the request seems ...
4
votes
1answer
2k views

PHP_Flag and PHP_Value Command Not Found Issue

We currently have a dedicated server with one company that is running apache, php, mysql etc. It currently has whm/cpanel installed. We are migrating to a new server with cpanel/whm. Everything ...
4
votes
2answers
3k views

code injected inside PHP file with 777 permission

I woke up to find that all the folders in my shared-web-host with 777 permission had two new php file. The code inside the file could not be read - here is the decoded version: ...
4
votes
9answers
3k views

Password Self-serve Active Directory via LAMP environment

I would like to be able to change active directory passwords via a Linux/Apache based webpage. This would be a self serve web page for the user. I have SSL-LDAP setup on the Active Directory to make ...
4
votes
3answers
5k views

How can I rewrite urls (ala mod_rewrite) for free in IIS 6?

I've got an application I wrote (with cakephp) for the lamp stack and I'm moving it to a windows server. I'm having a lot of trouble with apache for windows (memory and cpu issues) so I would like to ...
4
votes
1answer
765 views

How to maintain PCI compliance on a LAMP server when repositories don't keep up with versions

We run Ubuntu Lucid 10.0.4 as the foundation of our LAMP environment. We are trying to become PCI compliant so that we can pass CC info through our server. We have run some third-party scans on our ...
4
votes
2answers
13k 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, ...
4
votes
2answers
10k views

How can i enable byte range request?

How can i enable byte range request? While pod casting on itunes it gives an error message "There is a problem with your feed. Your episodes are hosted on a server which doesn’t support byte-range ...
4
votes
5answers
3k views

PHP broken after upgrading to php 5.4

on an ubuntu 12.04 i have upgraded to PHP 5.4 according to this tutorial http://www.upubuntu.com/2012/03/how-to-upgrade-install-php-540-under.html But when i call php5 -v i get PHP Warning: PHP ...
4
votes
3answers
6k views

Php5-fpm Crash if much visitors

I decided to change my OP to Nginx from Litespeed because i read much about the low resource that Nginx would cost. Im running a Wordpress site with 500 users online Okay thanks Guys for that much ...
4
votes
1answer
219 views

What exactly does SuPHP do?

And is it necessary? I've read a bunch of pages on it and I can't for the life of me actually figure it out, as opposed to what apache and just plain old php already do.
4
votes
3answers
262 views

Proper permissions for two developer team on PHP5 Apache Linux server

I was hoping someone could point me in the right direction regarding Linux permissions. I understand how to calculate what permissions are, understand the methodology behind changing them and can ...
4
votes
1answer
1k views

How can I install a custom (patched) PECL extension?

I'm trying to use the htscanner PECL extension on my CentOS 5/PHP 5.2.6 machine, but there's a bug in the latest version where a newline character is added to the end of every php_value directive. ...
4
votes
2answers
8k views

what chmod and owner:group settings are best for a web application?

we are configuring a PHP web application on CentOS and have all our files currently in /var/www/html/project/ Apache is configured to run as apache:apache and has access to the directory above. Right ...
4
votes
2answers
307 views

Hardened PHP deployment on Ubuntu

I've been asked to create a PHP environment on a web-server I administer that is currently only running Python applications. The authors of these applications don't necessarily have a programming ...
4
votes
2answers
293 views

How To Deal With Frequent And Constant PHP/MySQL Version Updates

The Problem: I know that many people are not so happy about frequent version changes. Especially when latest version of PHP or MySQL that you are stick to is no longer available in your repository ...
4
votes
3answers
5k views

What is the easiest way to setup a linux server to send mail?

I'm just about finished setting up the basics of my new ubuntu server - I don't have very much experience with Linux. I only need to be able to send email from my server - but it seems to be really ...
4
votes
2answers
1k 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 ...
4
votes
3answers
6k views

Apache2: 400 Bad Request with Rewrite Rules, nothing in error log?

This is driving me nuts. Background: I'm using the built-in Apache2 & PHP that comes with Mac OS X 10.6 I have a vhost setup as follows: NameVirtualHost *:81 <Directory ...
4
votes
1answer
5k views

How to configure nginx+php (fcgi) to run every subdomain with a different user?

Im pretty new to nginx and - more for learning purpose - im trying to configure Nginx in order to run php with a different user for every subdomains. For example, i would like to use user john for ...
4
votes
9answers
3k views

How can I test the security of my server?

How can I test the security of my server ? Please I know it is too general question. But I was wondering if there is a tester software or web service checking all ports of your server, or possibly ...
4
votes
2answers
7k views

Enable PUT method on apache for any php script

I would like to enable the PUT and DELETE methods to any .php script on my Apache web server. Currently I only have this answer : The requested method PUT is not allowed for the URL ...
4
votes
3answers
4k views

PHP 5.2x on Ubuntu 10.04 Lucid Lynx

It appears that Lucid Lynx comes with PHP 5.3. Is there a convenient way to downgrade to the latest 5.2x release?
4
votes
1answer
5k views

PHP mail() not working with Postfix on Ubuntu

I recently purchased a VPS plan. I installed Ubuntu 9.10, PHP5 and Postfix. I can't get the PHP mail() function to work. In my PHP script, the mail() function returns true, which suggests it is ...
4
votes
3answers
159 views

What's a good resource for learning about scaling PHP applications?

I know PHP fairly well. But one aspect of PHP which I am fairly green in is caching, loading balancing etc. A lot of companies hiring PHP developers are looking for these high-use background, which ...
4
votes
3answers
3k views

Dynamic nginx domain root path based on hostname?

I am trying to setup my development nginx/PHP server with a basic master/catch-all vhost config so that I can created unlimited ___.framework.loc domains as needed. server { listen 80; ...
4
votes
1answer
6k views

How to install/enable GMP (math functions) for PHP on Ubuntu?

When calling a gmp math function like gmp_mod, I get: Fatal error: Call to undefined function gmp_mod() I have installed the php5-gmp package and restarted the web-server, and the function is still ...
4
votes
4answers
4k 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 ...
4
votes
1answer
5k views

How to log outgoing http requests from PHP + cURL?

I have a PHP script set up that makes cURL requests whenever an action is performed on a site. The problem is that the information is being POSTed twice whenever the action is run. I need to work ...
4
votes
2answers
826 views

“su _www helloworld.php” does nothing

In the context of a larger effort, I've run across a particular issue that is baffling me. On Mac OS X 10.6.7, using the system provided Apache and PHP, I have created a simple HelloWorld.php script ...
4
votes
3answers
6k 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 ...
4
votes
2answers
2k views

php pear: The default config file is not a valid config file or is corrupted

I'm really in deep sh*t here. While running "pear install HTTP", my server get rebooted, when everything back, I continue my work, and... $sudo pear install HTTP ERROR: The default config file is not ...
4
votes
3answers
5k views

Why is PHP $_REQUEST array empty?

I installed nginx on Ubuntu Hardy and immediately realized that the PHP scripts were getting empty request arrays, ie whether GET or POST nothing was coming through, even the $_REQUEST array was ...
4
votes
5answers
4k 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?
4
votes
3answers
7k views

Can Nginx handle php (or similar fcgi) requests inside of an alias?

I am converting a legacy Apache server to Nginx and do not have the luxury of changing URL's or rearranging the filesystem. Is it possible to use nested location{} blocks in the Nginx configuration ...
4
votes
1answer
98 views

“Couldn't resolve host” for any external content

On our site we run a few different scripts for various sites (uploading to amazon s3, data from chartbeat, script to count twitter followers) and all of them just stop working from time to time. They ...
4
votes
1answer
446 views

Nginx - Enable PHP for all hosts

I am currently testing out nginx and have set up some virtual hosts by putting configurations for each virtual host in its own file in a folder called sites-enabled. I then ask nginx to load all ...
4
votes
2answers
262 views

signal Segmentation fault after specific url access

In my PHP program when I access specific URL (POST some data) the request has been aborted and this logs appear in Apache error.log: WARNING: HOME is not set, using root: / [Thu Sep 13 22:49:47 ...
4
votes
1answer
766 views

Strace Apache process output showing 24 seconds wait?What can be the reason?

Performed strace on one one of the apache children and its showing 24 seconds between two system calls.How can i determine what is the cause of this behavior.It looks like both children are taking ...
4
votes
2answers
192 views

text compression in postfix

I'm having the following arrangement. One server compiling emails in php and another server which run postfix (thus I have network latencies). Each email is about 300Kb and so as to send an email ...
4
votes
1answer
4k views

PHP/APC fatal error, apc_mmap: mmap failed

I'm seeing some intermittent CPU usage spikes to 100%, sort of correlated to these log entries: [27-Feb-2012 13:29:29] PHP Fatal error: PHP Startup: apc_mmap: mmap failed: in Unknown on line 0 ...
4
votes
1answer
328 views

PHP is slower than it should be

I have a server with Dual Xeon Quad Core L5420 running at 2.5GHz. I've been optimizing my server, and have come to my final bottleneck: PHP. My very simple PHP script: ./test.php <?php ...
4
votes
2answers
491 views

Installing PHP on linux

I'm trying to setup php with oci8 support. I think I've configured all correctly before starting with oci, here is how I tried to start the install : ./configure -prefix=/common_share/APACHE/server ...
4
votes
1answer
516 views

What am I (a beginner) losing, by choosing Cherokee over Apache for serving dynamic content?

I am a complete beginner and am planning to setup a photo sharing site. This is the setup I am planning, basically for a start - - Cherokee (instead of Apache) for serving dynamic content ...
4
votes
4answers
5k views

.htaccess RewriteCond for REMOTE_ADDR while behind Load Balancer?

I have a web server behind a load-balancer. I need to add a conditional redirect to my .htaccess in order to display a maintenance page whenever we take the site offline for maintenance. This part is ...
4
votes
1answer
4k views

NGINX not executing PHP files

I could not find an answer for this. Installed PHP5 + NGINX + PHP-FPM and can not execute php files, it get a "Oops! This link appears to be broken." error in CHROME. I do not have any valuable error ...
4
votes
3answers
11k views

How do I get PHP 5.3 working on Red Hat Enterprise Linux, with PDO enabled? PHP53 was installed with yum

This problem is complicated, and I'm not an expert at all, so bear with me. My server admin team set me up with a standard RHEL box. It had PHP preinstalled, as well as apache. I am now trying to ...