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
594 views

Common PHP setup insecurity?

I work with the systems administration at a university and just stumbled across something which is probably common, but was quite a shock to me. All public_html directories and web areas are stored ...
10
votes
1answer
4k views

apache on centos 5.6 gives me permissions denied error

I'm running apache on centos 5.6 and whenever i try to load a php script in any directory, other than /var/www/html (the apache default root dir) it gives me a permissions denied error. However when ...
10
votes
2answers
13k views

What are the steps to make the php mail() function work on ubuntu-server?

I want to enable the simple php mail() function on an Ubuntu server. This will only be used for sending administration stuff and logs. This is all the mail functionality that I want on this machine. ...
10
votes
4answers
2k 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 ...
10
votes
2answers
587 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 ...
9
votes
11answers
21k 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 ...
9
votes
8answers
860 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
615 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
2answers
21k views

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

I'm a newbie 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 ...
9
votes
3answers
8k 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
3answers
12k views

Why are outdated packages installed by yum on CentOS? (specifically PHP 5.1) How to fix?

I'm working on a fresh CentOS server and am extremely annoyed to find out that yum does not work as smoothly and brilliantly as "apt-get install" does on Ubuntu. Installing a LAMP stack, I ran the ...
9
votes
2answers
312 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
32k 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
18k 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
36k 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
14k 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
15k 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
16k 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
31k 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 ...
9
votes
2answers
15k 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?
9
votes
1answer
318 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
16k 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
7k 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
1k 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
2answers
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 ...
8
votes
2answers
19k views

php - error: Cannot find OpenSSL's <evp.h>

Im trying to recompile PHP, but ./configure fails at : configure: error: Cannot find OpenSSL's <evp.h> I have LibSSL 1.0.0, LibSSL 0.9.8, LibSSL-Dev, OpenSSL installed. ...
8
votes
3answers
16k 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
5answers
25k 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
4answers
5k 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 ...
8
votes
5answers
7k 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 ...
8
votes
4answers
339 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
5k 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 = ...
8
votes
6answers
520 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
9k 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 ...
8
votes
2answers
17k views

nginx / php-fpm error logging

I'm trying to figure out where the PHP errors are going in my setup. I'm running nginx as the reverse proxy to PHP-FPM, but I'm not seeing the various E_NOTICE or E_WARNING messages my app is ...
7
votes
8answers
681 views

Multi-site hosting - important vulnerability being missed to secure sites from each other?

EDIT #2 July 23, 2015: Looking for a new answer that identifies an important security item missed in the below setup or can give reason to believe everything's covered. EDIT #3 July 29, 2015: I'm ...
7
votes
1answer
7k views

Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM

There are few different php "wrappers"(?). What are differences between them? Tried to google some, but cant seem to find informations. (mod-php is not googleable). Why might I choose one over ...
7
votes
3answers
7k views

How to create robots.txt file for all domains on Apache server

We have a XAMPP Apache development web server setup with virtual hosts and want to stop serps from crawling all our sites. This is easily done with a robots.txt file. However, we'd rather not ...
7
votes
6answers
11k views

Apache2 Proxy timeout

I have Apache2 with PHP + PHP-FPM configured according to: http://wiki.apache.org/httpd/PHP-FPM I am writing a script that will take a long time to execute on an internal Vhost, but keep getting ...
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
29k 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
10k 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
1answer
13k 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
29k views

RSA certificate configured for SERVER does NOT include an ID which matches the server name

I recently started a LAMP server (all the latest versions) w/ WordPress on it, and I'm trying to install a SSL certificate that I recently purchased. When I restart apachectl, error_log gives me this: ...
7
votes
6answers
3k 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
34k 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
2answers
12k views

500 error on fresh install of IIS and PHP

When attempting to run a PHP file on Windows server 2012 and IIS, I keep getting a 500 error. I cannot find any detaild logs or anything. However, when going to PHP Manager for IIS and click check ...