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

1
vote
1answer
1k views

Outgoing mail from linux not being delivered

I can't seem to send mail through my php scripts or through the linux console on my Centos 5.5 LAMP server, when the email is addressed to go to a domain that is hosted by my box. I think it is ...
1
vote
2answers
733 views

What do I need to parse incoming emails?

My intention is to parse incoming emails with PHP. What would be the simplest way to set this up? Would it suffice to rely on Postfix for this, or is there a better alternative? The purpose of the ...
9
votes
3answers
3k views

Secure LAMP server for production use

What is the procedure for securing a Linux, Apache, MySQL, PHP Server (or even Perl) for production use? Other than setting the MySQL password and the root password for Linux what other (maybe not so ...
4
votes
2answers
2k views

How to fetch ./configure parameters used at last time?

I am upgrading LAMP stack on customer's server and need to ./configure mysql and apache with exact last settings they were compiled with last time. Where do I get these? PHP configure string can be ...
3
votes
4answers
4k views

Is it Possible to view my apache server (local host) from home or remote computer that is outside my LAN?

i am developing a website and need to share progress with other stakeholders. Is it Possible to view my apache server (local host) from home or remote computer that is outside my LAN?
21
votes
5answers
19k views

Can a pool of memcache daemons be used to share sessions more efficiently?

We are moving from a 1 webserver setup to a two webserver setup and I need to start sharing PHP sessions between the two load balanced machines. We already have memcached installed (and started) and ...
15
votes
3answers
27k views

How do I upgrade to the latest PHP version in CentOS with yum?

I found some blog posts about this, but it's rather lack of descriptions on possible side effects. I could really use some detailed on these steps: How to add a repo that provides PHP 5.4 into yum ...
10
votes
8answers
30k 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 ...
4
votes
5answers
7k 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 ...
9
votes
4answers
14k 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 ...
13
votes
2answers
30k views

How can I display and log PHP errors on IIS7?

We're running PHP 5.2.5 on an IIS 7 Server and we're having problems making PHP errors visible... At the moment whenever we have a PHP error the server sends back a 500 error with the message "The ...
2
votes
5answers
4k views

Why is PHP script downloaded instead of executed

I have a local LAMP server set up on my Ubuntu laptop for testing various PHP scripts. Sometimes, when I do something wrong, instead of getting an error, the script I'm testing is offered for ...
0
votes
2answers
324 views

php not working on my VPS

This is my phptest.php file: <?php echo "Hello"; ?> But when I try 'http://serveraddress/phptest.php'on my browser,it does not work properly and shows the whole php file on my browser. I ...
0
votes
2answers
733 views

My php homepage downloads index.php instead of being processed on Gandi.net

if I go to the homepage of my website http://www.website.com (on a brand new server) the index.php gets donwloaded instead than processed. I don't have the same problem on other folders. my .htaccess ...
53
votes
10answers
40k views

memcache vs memcached?

I want to use memcached http://www.danga.com/memcached/ I have installed it through yum install memcached But now I need to connect to PHP, and there is an extension named memcache and one named ...
16
votes
4answers
11k views

How can I determine the cause of an apparent memory leak in my Apache/PHP based web app?

About once a week, but sometimes even a couple of times a day after running fine for days, my EC2 instances become unresponsive. Munin's memory graphs tell a pretty straightforward story: memory ...
23
votes
13answers
42k views

Why is the response on localhost so slow?

I am working on a tiny little PHP project for a friend of mine, and I have a WAMP environment setup for local development. I remember the days when the response from my local Apache 2.2 was immediate. ...
10
votes
3answers
1k views

The A to Z of setting up a Linux box for secure local hosting

I am in the process of reinstalling the OS on a machine that will be used to host a couple of applications for our business. The applications will be local only; access from external clients will be ...
26
votes
4answers
32k views

Setup ubuntu server to send mail()

I tried searching a lot but unable to find how to actually setup a ubuntu server, so that I can send mails through php using mail() function in php. I have apache2, mysql and php5 installed on my ...
7
votes
7answers
24k 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 ...
6
votes
4answers
773 views

Any security tips for my first server? (complete beginner)

I'm paying for a VPS and hoping to launch my first website on it in the next few days. I'm worried there might be some glaringly obvious security holes in the standard setup, so I'm keen to get some ...
5
votes
8answers
3k 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, ...
4
votes
5answers
10k 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 ...
3
votes
3answers
3k 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 ...
8
votes
3answers
7k 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) ?
1
vote
7answers
6k views

Apache is not interpreting .PHP files

I recently downloaded OpenSUSE OS version 11.4 from the site to use it as a server..In order to do that I downloaded the server edition that has Apache/2.2.17 and PHP5 downloaded by default.....Ok ...
28
votes
8answers
3k views

Securing PHP webservers

PHP applications have a reputation for higher than average security problems. What configuration techniques do you use for making sure the application is secure as possible? I'm looking for ideas ...
25
votes
4answers
2k views

Why Swap is used when plenty of free memory is left?

I have pretty good web (dedicated) server with good memory resource System information Server load 2.19 (8 CPUs) Memory Used 29.53% (4,804,144 of 16,267,652) Swap Used 10.52% ...
3
votes
3answers
5k views

cakephp & nginx config/rewrite rules

Hi somebody please help me out, I've asked this at stackoverflow as well but not got much of a response and was debating whether it was programming or server related. I’m trying to setup a cakephp ...
17
votes
8answers
6k views

Dropbox alternative [closed]

I'm looking for something like Dropbox (or centraldesktop) that I can host locally. I would like users to be able to upload (bonus for multiple upload) and download files into a file structure. ...
2
votes
6answers
6k views

Apache, nginx, or lighttpd? [closed]

I am going to be live blogging from an event and expect huge spikes in traffic. I am currently using apache with modphp and it died last year under heavy traffic and I don't want it to happen again. ...
7
votes
2answers
2k 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, ...
5
votes
1answer
8k views

Apache MPMs - Worker vs Prefork

I'm trying to figure out what which is the best Apache MPM I can install on my VPS. I saw some benchmarks and MPM Worker seems to perform better than the Prefork one but for some reason everyone seems ...
5
votes
11answers
13k 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 ...
2
votes
2answers
4k views

Running multiple versions of PHP on Ubuntu

Is there an easy way to run multiple versions of PHP on Ubuntu 10.04 (desktop), and switching between them? I am spoiled with the very easy installation and switching of PHP in WAMP for Windows. This ...
13
votes
1answer
4k views

Multiple php versions simultaneously on Ubuntu

I want to be able to run multiple php versions on my development box running Ubuntu 12.04. What I want to accomplish is that when I use localhost as domain a default is used (let's say php 5.3.17). ...
3
votes
1answer
1k views

Cent OS upgrade PHP

I'm in the midst of resolving a bunch of security issues on a clients server to get them compliant with credit card laws and such. The first order of business is getting php from 5.2.14 to 5.2.16. ...
2
votes
2answers
7k views

Alias using Nginx causing phpMyAdmin login endless loop

Recently I've been trying to set up a web server using Nginx (I normally use Apache). However I've ran into a problem trying to set phpMyAdmin up on an alias. The alias correctly takes you too the ...
2
votes
3answers
311 views

Securing and Monitoring a Virtual Private Server

After nearly a decade (yikes) of hosting my personal websites and applications with a decent shared web hosting provider (the one in pittsburgh) I've decided its time to venture out on my own and try ...
5
votes
1answer
3k 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. ...
5
votes
3answers
1k 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 ...
3
votes
2answers
2k 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"]; ...
0
votes
1answer
3k views

Apache: How to switch to CGI/FastCGI Server API?

I've installed the mod_fastcgi on my Apache and put LoadModule into my httpd.conf file. When I do a phpinfo(), mod_fastcgi is in the loaded modules section, but the server API still shows up as ...
9
votes
4answers
31k 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 ...
6
votes
6answers
18k views

What is swap memory?

I am using RAM for storing some of my database tables and the others are stored in hard disk. Today I came to know that my processes are using swap memory. Now what is swap memory and how can I ...
5
votes
5answers
51k views

How do I enable SQLite on Linux/Apache/PHP?

To enable SQLite on my Windows/Apache/PHP setup, I uncomment the following lines in the php.ini file and restart Apache: extension=php_pdo.dll extension=php_pdo_sqlite.dll Now I have a VPS with ...
4
votes
3answers
5k views

How to use FastCGI globally and Basic Auth in sublocations in nginx?

I recently deployed my first nginx setup and everything works really nice, except the location parsing is driving me nuts. I have a simple php fastcgi setup like this: location ~ \.php { if (!-e ...
3
votes
5answers
541 views

Good starting resources for system administration

I'm a PHP web developer and I'd like to start learning more about system administration and was wondering if anyone had any good resources/starting points to look at. I have an old computer I can ...
2
votes
1answer
368 views

Why HTTP sniffers aren't able to capture PHP generated HTTP traffic?

I can't get why HTTP Analyzer (I prefer this one because it is capable of decoding SSL encoded data transfered through HTTPS) isn't able to capture PHP generated HTTP traffic. It capture HTTP traffic ...
2
votes
4answers
6k views

Recommended method to upgrade PHP 5.1.6 to 5.2.x on CentOS 5.4

It's been awhile since this type of question was asked here. Perhaps the recommended solution has changed. I have a CentOS 5.4 mail server running RoundCube webmail. By default, RoundCube expects PHP ...