Questions tagged [php]

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.

Filter by
Sorted by
Tagged with
183 votes
18 answers
1.1m views

How do you restart php-fpm?

I need to reload my php.ini and there's nothing in the help dialog about restarting it.
Galen's user avatar
  • 1,983
104 votes
1 answer
128k 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 ...
Gacek's user avatar
  • 1,201
76 votes
9 answers
71k 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 ...
thanksyo's user avatar
  • 839
74 votes
8 answers
267k 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. ...
Peter Perháč's user avatar
66 votes
3 answers
199k views

php cli memory limit

I am getting a memory error in a php cron job: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /opt/matrix/core/lib/DAL/DAL.inc on line 830 The ...
Ryan H's user avatar
  • 1,478
66 votes
13 answers
344k views

104: Connection reset by peer while reading response header from upstream (Nginx)

I have a server which was working ok until 3rd Oct 2013 at 10:50am when it began to intermittently return "502 Bad Gateway" errors to the client. Approximately 4 out of 5 browser requests succeed but ...
Nigel Alderton's user avatar
57 votes
8 answers
151k views

how to restart/clear memcache without restarting the whole web server?

/opt/eduserver/eduserver gives me options: Usage: /opt/eduserver/eduserver {start|stop|startphp|startwww|startooo|stopphp|stopwww|stopooo|restartphp|restartwww|restartooo|status|restart|reload|...
Radek's user avatar
  • 1,153
56 votes
7 answers
77k views

PECL command produces long list of errors

Currently running PHP 5.4 on CentOS 6.5. I installed the webtatic php55w package then installed PEAR+PECL without issue along with redis and mongo through PECL. Shortly after, I realized 5.5 is not ...
eComEvo's user avatar
  • 1,021
48 votes
1 answer
142k views

Can't start php-cgi.exe - MSVCR110.dll is missing [closed]

Trying to setup nginx and php on my Windows machine, but every time I try to start php-cgi.exe I get a system error. The program can't start because MSVCR110.dll is missing from your computer. ...
Marwelln's user avatar
  • 599
47 votes
3 answers
101k views

How do I upgrade from PHP 5.3 to PHP 5.4.6 in Ubuntu?

Is there an easy way out to get the latest PHP? I have tried updating my package but none of it has 5.4.6 yet... if anyone knows on how to do it quickly, can it be shared here? I've tried compiling ...
user79356's user avatar
  • 627
47 votes
1 answer
78k views

Curl POST - 411 Length Required

We have a RestFUL API we build in PHP. If we make the request: curl -u api-key:api-passphrase https://api.domain.com/v1/product -X POST We get back: 411 - Length Required Though if we simply add -...
Justin's user avatar
  • 5,388
46 votes
3 answers
359k views

How to check my PHP and MySQL version on Ubuntu VPS?

HI I am going to install MyBB but I am not sure whether I have installed the correct version of PHP and MySQL. PHP version 5.1.0 or above with XML Extension installed MySQL version 4.0 or ...
DocWiki's user avatar
  • 683
46 votes
1 answer
65k views

how to install an older version of a pecl package

I have this code $passengerId = new \MongoId(oPassenger->getId()); return $this->createQueryBuilder('Device') ->update() ->multiple(true) ->field('...
abbood's user avatar
  • 1,127
44 votes
15 answers
167k views

phpMyAdmin Error - The configuration file now needs a secret passphrase

I keep getting an error "The configuration file now needs a secret passphrase" after installation of phpmyadmin. I have set the passphrase and also followed the instruction presented on https://...
jax's user avatar
  • 551
43 votes
4 answers
134k views

What time zone is a cron job using?

I'm guessing there's a difference between my PHP time and the server time. When I check the current time in PHP, it's showing that MST is being used. However, cron jobs aren't running at the correct ...
Edward's user avatar
  • 533
43 votes
6 answers
38k views

Which PHP (opcode) cache one should use and why?

I keep hearing about some PHP (opcode) caches like - APC, XCache, Memcache, eAccelerator, etc. But I couldn't ever figure out how to go about choosing one. Apart from performance benefit, which a ...
rahul286's user avatar
  • 1,657
42 votes
4 answers
83k 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 ...
Shishant's user avatar
  • 683
41 votes
4 answers
38k views

What's a secure alternative to using a MySQL password on the command line?

We have a PHP command-line script to version a database. We run this script whenever a developer has added a new database patch. The script runs the patch with the MySQL command-line: system('mysql -...
BenMorel's user avatar
  • 4,557
41 votes
11 answers
2k views

Got Hacked. Want to understand how

Someone has, for the second time, appended a chunk of javascript to a site I help run. This javascript hijacks Google adsense, inserting their own account number, and sticking ads all over. The ...
Lothar_Grimpsenbacher's user avatar
40 votes
4 answers
210k 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 ...
nicorellius's user avatar
40 votes
3 answers
112k 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 ...
James Skemp's user avatar
39 votes
4 answers
24k views

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

I have pretty good web (dedicated) server with good memory resources: System information Server load 2.19 (8 CPUs) Memory Used 29.53% (4,804,144 of 16,267,652) Swap Used 10.52% (220,...
mahen3d's user avatar
  • 4,382
39 votes
6 answers
110k 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 ...
Silvio Donnini's user avatar
39 votes
5 answers
149k views

How do I tell Apache which PHP to use?

I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think). This terminal command: php --version is showing 5.2.8 and I have the right ...
Sam McAfee's user avatar
37 votes
10 answers
115k views

How to solve `configure: 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. --with-openssl=/usr/...
CappY's user avatar
  • 513
35 votes
3 answers
13k views

How do you Install PHP5 without installing Apache in ubuntu?

Is it possible to install PHP5 without installing apache, in Ubuntu? If so, how?
Ryan's user avatar
  • 5,931
34 votes
4 answers
88k 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 detailed logs or anything. However, when going to PHP Manager for IIS and click check ...
alexander7567's user avatar
34 votes
1 answer
94k views

What is the name and location of the Nginx config file (htaccess equivalent)?

There are many tutorials on how to write Nginx rewrite rules to mimic Apache's .htaccess file but I can't confidently say I know what the name or location of this so-called Nginx config file actually ...
tim peterson's user avatar
33 votes
6 answers
213k 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: ...
eclipsis's user avatar
  • 433
33 votes
3 answers
13k views

PHP: What are the advantages of FastCGI over mod_php?

It was recently suggested to me that I use FastCGI with PHP. Now I went to the FastCGI page and read it but I don't really understand what the advantages are.
cletus's user avatar
  • 10k
33 votes
6 answers
82k 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 ...
Ben's user avatar
  • 463
32 votes
4 answers
122k views

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

I need to downgrade PHP on one of my VMs from 7.2 to 7.1 on Ubuntu 16.0.4. The last time I tried to remove just PHP and replace it with a different version, I had all kinds of issues with Apache and ...
Pegues's user avatar
  • 901
31 votes
5 answers
14k views

Why not use a WAMP stack?

This is a canonical question about the use of a *AMPP's stack. I recently had a talk with some experienced people and they suggested to me not to use a WAMP stack, and instead install apache, mysql ...
matang's user avatar
  • 446
31 votes
8 answers
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 ...
David Pashley's user avatar
30 votes
6 answers
9k views

How do I find out where the web site's code resides?

The facts: there is a website this website is accessible via www.example.org there is an EC2 instance which very likely keeps the website the server is Apache the server OS is Ubuntu I have full ...
Raffael's user avatar
  • 689
30 votes
1 answer
102k 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 ...
Sandeepan Nath's user avatar
30 votes
2 answers
33k views

Why does Debian clean php sessions with a cron job instead of using php's built-in garbage collector?

Debian and derivatives (Ubuntu) don't use the php session garbage collector session.gc_probability = 0 instead they use a cron /etc/cron.d/php5 09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] &...
nulll's user avatar
  • 505
29 votes
9 answers
106k 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 ...
wyqydsyq's user avatar
  • 405
29 votes
5 answers
73k views

Permission Denied for fastcgi_pass using PHP7

I'm running LEMP with PHP7.0. I've got this in my server block fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; But when I open the site, it returns a 502 Bad Gateway. Below is the error log. *1 ...
julio's user avatar
  • 924
28 votes
11 answers
104k views

MySQL cannot connect via "localhost", only 127.0.0.1

this is somewhat of a mystery to me. The only way I can connect to MySQL is if I call it via "127.0.0.1" ... for example, my PHP connect script will NOT work with localhost I'm running Mac OS X Lion, ...
dcolumbus's user avatar
  • 475
28 votes
1 answer
29k views

php-mysqlnd or php-mysql

Long story short: just installed Ubuntu 12.04 (Debian based), nginx, php-fpm and mysql. Now I need the MySQL driver for PHP, but which should I choose? Which is better php-mysqlnd or php-mysql?
Thomas Jensen's user avatar
28 votes
1 answer
47k views

Memory Usage Numbers In top/htop

Can someone please explain this top output. Each PHP process is using 30% of the total memory or of the used memory? Furthermore how can it be that the combined used memory across all the PHP ...
Mem's user avatar
  • 301
27 votes
5 answers
39k views

Apache file negotiation failed

I'm having the following issue on a host using Apache 2.2.22 + PHP 5.4.0 I need to provide the file /home/server1/htdocs/admin/contents.php when a user makes the request: http://server1/admin/...
lorenzo.marcon's user avatar
26 votes
1 answer
23k views

How to add directives to php.ini on AWS Elastic Beanstalk?

I'd like to add these PHP settings to my Elastic Beanstalk environment: upload_max_filesize = 64M post_max_size = 64M These options cannot be set with option_settings in .ebextensions: Namespace ...
BenMorel's user avatar
  • 4,557
25 votes
5 answers
32k 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 ...
Tom's user avatar
  • 4,307
25 votes
7 answers
42k views

Where is apc.php?

Using Ubuntu server 10.4, I apt-getted php-apc Where is the apc.php file that I'm meant to copy? Thanks!
user avatar
25 votes
2 answers
75k 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 ...
Calvin's user avatar
  • 361
24 votes
6 answers
93k views

Connecting to MySQL from PHP is extremely slow

I just did a fresh install of XAMPP. When first opening PHPMyAdmin I noticed it was extremely slow. It didn't make sense that on localhost it should take almost 5 seconds for every page to open. I ...
Hubro's user avatar
  • 1,148
24 votes
4 answers
57k views

How to automatically and temporarily block an IP address making too many hits on the server in a short timespan?

One of my LAMP servers was recently brought down by some kind of script bot looking for exploits. From the looks of it, it was making so many requests a second, that it overloaded the RAM on the ...
ProgrammerGirl's user avatar
23 votes
16 answers
3k views

Why is it bad to have a weak mysql user password?

I was presented with an argument to the tune of "you don't need a strong mysql user password because in order to use it, they'd already have access to your server." We're talking about a 4 digit ...
Citizen's user avatar
  • 560

1
2 3 4 5
159