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

10
votes
4answers
1k views

How can I check if PHP was compiled with the UNICODE version of the Win32 API?

This is related to this Stack Overflow post: glob() can't find file names with multibyte characters on Windows? I'm having issues with PHP and files that have multibyte characters on Windows. Here's ...
9
votes
8answers
850 views

Building a Student Storage server

I work for a school district. I've been put in charge of building a storage server for students. A place for them to work off of from school and home. My challenge is getting this to work from ...
9
votes
2answers
597 views

My server Admin wants me to set public write permissions on a directory

I'm relatively new to web development, so please be patient. I'm primarily an iPhone developer, but have recently done a site for someone else using shared hosting. I could write to files in PHP on ...
9
votes
3answers
7k views

AWS RDS connection count

I am using AWS RDS with MySQL for a project and have a "large" instance. The documentation is clear on what this means as far as compute resources and RAM goes, but I can't find anything that ...
9
votes
2answers
307 views

My server setup for a heavily used API

I will soon be buying a bunch of servers for an application that I am about to launch but I have concerns about my setup. I appreciate any feedback I get. I have an application which will make use of ...
9
votes
8answers
31k views

How do I install PHP 5.3 on CentOS?

I have to install PHP 5.3 on my CentOS server. If I do yum install php, the base repository installs 5.1.6 which is too old for the applications I need to install. So I've been trying to use the IUS ...
9
votes
4answers
17k views

How do I set up per-site php.ini files on a LAMP server using NameVirtualHosts?

I have a LAMP server serving a number of different websites using NameVirtualHosts. Until recently having a global php.ini file has been just fine, but recently one of our developers has requested ...
9
votes
4answers
34k views

How to --enable-dom without recompiling PHP?

From the output of phpinfo(), --disable-dom are included the configure command. How do I change it to --enable-dom without recompiling PHP? Edit: I'm using Fedora 10. The PHP i'm using is the one ...
9
votes
5answers
13k views

PHP 5.3.1 Undefined Symbol: OnUpdateLong error on Apache Startup

I'm running Ubuntu 8.04 on this server. I had PHP 5.2 installed via the package manager. I removed it to install PHP 5.3.1 by hand. I built the packages like so ./configure --prefix=/opt/php ...
9
votes
2answers
4k views

mod_rewrite does not forward GET parameters

I'm having trouble setting up Apache with mod_rewrite on my development machine. Mod_rewrite is active, and works well for some rules. Some rules do not work as intended, like this one: RewriteRule ...
9
votes
3answers
12k views

Change default from address from Postfix from www-data to something else

Setting up Postfix and Apache/PHP on an Ubuntu server. Mail's now going out ok with the proper domain name, but the local part display name is always "www-data" as I'm assuming Postfix uses the name ...
9
votes
3answers
14k views

Content-Length not sent when gzip compression enabled in Apache?

I would really appreciate some help understanding this Apache behaviour. I am communicating to PHP from an iPhone Objective-C app in application/json. Gzip compression is enabled on the server, and ...
9
votes
2answers
22k views

PHP exit status 255: what does it mean?

I recently compiled a php 5.2.9 binary, and I tried to execute some php scripts with it. I can execute some scripts without problems, but one of them halts its execution midway, exiting with no errors ...
9
votes
1answer
224 views

Using IE to invoke PHP/CURL for long running data API causes Apache2 server to freeze and require restart

I'm running a PHP program that works fine as long as it's not invoked by a Microsoft IE browser, after which it spawns the below processes, locks up Apache2 and requires a restart of the web server ...
9
votes
5answers
14k views

PHP on Linux: How to make PHP use proxy settings to connect to internet?

my server is in a LAN and is connected to internet through a Proxy Server. my PHP application (Drupal), should be able to check for updates through PHP codes. how can i set Proxy Settings for PHP so ...
9
votes
1answer
6k views

Why does Cacti keep waiting for dead poller processes?

I am currently setting up a new Debian (6.0.5) server. I put Cacti (0.8.7g) on it yesterday and have been battling with it ever since. Initial issue The initial issue I was observing, was that my ...
9
votes
11answers
902 views

.htaccess doesn't redirect to www-prefixed page properly

I'm trying to redirect an url without www. to www.version (example.com to www.example.com). I use the usual RewriteCond %{HTTP_HOST} ^example\.com [nc] RewriteRule (.*) http://www.example.com/$1 ...
9
votes
1answer
3k views

Why so many gettimeofday calls?

Why does the PHP/Apache combo do so many gettimeofday syscalls? Even though the're quick every call is a call which should be accounted for. Just a quick strace -c -p [apache2 process id], gives the ...
9
votes
2answers
514 views

MediaWiki slow save of edited pages

I have MediaWiki 1.16.2 on a the following LAMP platform, which performs quite good for other apps on a 16 GB RAM dual processor machine: CentOS 5.7 (64-bit) Apache 2.2.3 MySQL 5.0.77 PHP 5.1.6 It ...
8
votes
11answers
17k views

How to watch logs in real time via Terminal?

This is a basic question - in the movie "The Social Network" there are several scenes when the young Facebook staff is watching the PHP/Apache server logs on in their TERMINAL in real time. I'm ...
8
votes
3answers
12k views

How to Upgrade PHP to 5.4.10 on CentOS 6.3

# cat /etc/redhat-release CentOS release 6.3 (Final) # php -v PHP 5.3.3 # yum update php No Packages marked for Update How do I upgrade to the latest version PHP 5.4.10 (Current stable) ?
8
votes
4answers
21k views

What permissions / ownership to set on PHP Sessions Folder when running FastCGI / PHP-FPM (as user “nobody”)?

I'm having trouble getting a number of scripts running because PHP-FPM can't write to my session folder: "2009/10/01 23:54:07 [error] 17830#0: *24 FastCGI sent in stderr: "PHP Warning: Unknown: ...
8
votes
2answers
28k views

Install php extensions on ubuntu

I have a Ubuntu 9.10 server. I have installed apache2 and php5 using the apt-get commands. How does one install php extensions? Are there commands like apt-get to get them? Or should I manually look ...
8
votes
2answers
25k views

How do I uninstall a Web Platform Installer (WPI) installation of PHP?

We've installed PHP on a Windows Server 2008 R2 box using Web Platform Installer (WPI) 3.0.x. However, I'd like to uninstall PHP (5.3 in particular, leaving 5.2 as-is). Unfortunately, an uninstall ...
8
votes
4answers
332 views

Paranoid Sysadmin -vs- Out-of-Date PHP version

How can a paranoid sysadmin confidently stay up-to-date with the latest stable PHP versions? (security fixes have been coming in pretty regularly). This is a Production server, and so "breaking ...
8
votes
4answers
5k views

Apc, xcache or eAccelerator? What should I use for Wordpress? [closed]

I'm trying to configure a server for a Wordpress site. What should I use for opcode caching? APC, xcache or eAccelerator?
8
votes
1answer
1k views

PHP on command line displays “Out of Memory”, no file name, line number or memory value

I originally posted this at http://stackoverflow.com/questions/9665189/php-on-command-line-displays-out-of-memory but was advised to post here instead. This is not the normal fatal error when you run ...
8
votes
2answers
14k views

Apache error log with PHP errors

I just set up PHP and Apache and would like to find where the errors are going. What is the default path of the error logs in apache for PHP?
8
votes
6answers
516 views

How to grow from single server setup

I'm looking for resources on how to grow our server setup. We currently have one dedicated server with Rackspace in the UK of the following spec: HPDL385_G2_PrevGen HP Single Dual Core Opteron 2214 ...
8
votes
1answer
8k views

How should I tune apache when I see high CPU, but low memory usage?

My CentOS web nodes (LAMP stack) are experiencing high CPU usage but low memory usage. Nearly all of the processes are apache. I know I could just add additional web nodes until my cpu usage becomes ...
7
votes
2answers
15k views

What kind of server do I need to handle 10 million requests and mySQL queries a day? [closed]

I'm a new bie of server administration and I'm looking for a powerful hosting service to host my new website. This website is basically a back-end of an mobile online game, and it will: handle up to ...
7
votes
7answers
6k views

Very simple SMTP server for Ubuntu wanted

I'm looking for a very simple, lightweight SMTP server to run on an Ubuntu 9.04 VPS. The only functionality I need is to support the PHP mail command; <?php mail('caffeinated@example.com', 'My ...
7
votes
7answers
26k views

How to configure php.ini with remote SMTP?

How do I configure PHP to send mail using mail() via a remote SMTP server? I've tried to do this using php.ini but it seems that you can only do that under Windows32 and I want to do this on my Unix ...
7
votes
2answers
9k views

Is mounting S3 buckets directly into EC2 instances safe?

as the title of my question says, I would like to know whether this is a good practice or not, I know I can mount it in an EC2 instance but I was wondering if, as I will be adding more instances to ...
7
votes
5answers
6k views

Find the php script thats sending mails

Is there any way for me to find the php script that is sending emails. I have apache+php ( no mod_suphp neither suexec ) in a "standard" install, and i want to find out witch php script is sending ...
7
votes
6answers
2k views

How can I keep Apache from falling over?

I have a pair of servers hosting a single Magento ecommerce site with moderate traffic (60k page views per day reported from google analytics, I think about 80k reported on the server itself). The ...
7
votes
5answers
30k views

Temporary failure in name resolution : Host name lookup failure

I've got a script in PHP that's been running fine for months. It recently stopped working. This script connects to gmail to send out an email to my customers. Recently, I started getting this error ...
7
votes
1answer
9k views

Apache .htaccess <ifModule not allowed here

Running Apache on Ubuntu Precise, with PHP 5.5 Trying to access my var/www/ gives me a 500. /var/log/apache2/error.log shows: /var/www/web/.htaccess: <IfModule not allowed here my .htacess is ...
7
votes
2answers
3k views

Error When Installing PHP5 on IIS6

I am trying to install PHP on my Windows Server 2003 machine that is using IIS6. I followed this guide for installing it, including using the binaries of fastCGI. I think I did everything correctly, ...
7
votes
1answer
5k views

Apache restart needed for PHP to re-read php.ini?

Does PHP read php.ini on each request or do I have to restart Apache for php to be aware of changes on php.ini?
7
votes
1answer
2k views

Security risks of having public phpinfo() page?

I have a publicly accessible page which just has <?php phpinfo(); > I use it for debugging purposes while we're in beta, but is there any harm in leaving it accessible when its a live site?
7
votes
2answers
4k views

uploading files greater than 1MB = connection resets

I'm using nginx on the frontend as "proxy cache" and apache on the backend, i've set my PHP settings to the following: error_log = /var/www/site1/php_error.log error_reporting = 22527 file_uploads = ...
7
votes
1answer
361 views

Is there any good reason not to increase upload_max_filesize and post_max_size?

As the sysadmin of a LAMP box I am being asked to raise the upload capacity of php/html forms to something around 70 MB. I believe the server can handle it since it has two quad cores and 4 Gig RAM. I ...
7
votes
1answer
664 views

How can I use SELinux to confine PHP scripts?

I want to compartmentalize different PHP applications on my SL6.4 (RHEL 6.4 rebuild) web server so that they cannot access each others' data. It seems that SELinux might be able to do this, but I am ...
7
votes
1answer
2k views

How can we restrict dynamically nginx upload/download speed per user?

It's possible to restrict the speed using the rate limit on a specific location. However, how can we do it dynamically ? Let say you have paid vs non-paid users and you want to give an higher ...
7
votes
2answers
5k views

Can't Login to phpPgAdmin

I'm trying to set up phpPgAdmin on my test machine so that I can interface with PostgreSQL without always having to use the psql CLI. I have PostgreSQL 9.1 installed via the RPM repository, while I ...
7
votes
3answers
2k views

linux: one apache two php versions. possible?

it seems that some of my php applications require php 5.2 and some require php 5.3. is there a way to configure apache (v2.2.14) that one virtualhost will work with one php library and a different ...
7
votes
4answers
11k views

Memory usage of php-cgi processes is growing steadily

I'm trying to set up a web server on a VPS. My problem is that memory usage of php-cgi processes increases over time even though the website is not receiving any traffic at all. (it is behind a ...
7
votes
2answers
3k views

Php pdo_dblib - cannot find/unable to load freetds

Self-hosted box, RHEL 6 PHP 5.3.3 PDO installed freetds installed pdo_dblib - so far no luck installing My goal is to use PDO with sybase. Attempting to install pdo_dblib from the appropriate ...
7
votes
3answers
1k views

Can I globally set $_SERVER['REDIRECT_URL'] before script execution?

I'm in the process of migrating many sites from an old to a new server configuration. Each site is based on a similar (but sadly not identical) codebase, using mod_rewrite URLs. Ubuntu 8.04 LTS => ...