# Which PHP extensions do I need?



## frijsdijk (Dec 27, 2012)

Hi,

Given a directory with a number of files that form an application/website, is there some util I can run that would analyze the code and tell me wich PHP extensions I would need to run that site?


----------



## Wiedmann (Dec 27, 2012)

You can try pear-PHP_CompatInfo.


----------



## SirDice (Dec 27, 2012)

Usually it's mentioned in the README of said software. It should tell you what it's dependencies are.


----------



## ericmacmini (Dec 27, 2012)

Try to run the application from your command line, it will return error messages with missing modules. 
We have installed the modules below, which is sufficient for Drupal and Wordpress which interacts with a MySQL backend database. 


```
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
filter
ftp
gd
hash
iconv
imap
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
pdf
PDO
pdo_mysql
Phar
posix
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
```


----------



## frijsdijk (Dec 27, 2012)

Wiedmann said:
			
		

> You can try pear-PHP_CompatInfo.



Great. Does the job!


----------



## frijsdijk (Dec 28, 2012)

ericmacmini said:
			
		

> Try to run the application from your command line, it will return error messages with missing modules.
> We have installed the modules below, which is sufficient for Drupal and Wordpress which interacts with a MySQL backend database.
> 
> 
> ...



This is alot more than you actually need. Which is exactly why I was asking this question... trying to optimise memory usage of Apache. Ever tested what the effect of Apache's memory usage (leaking or not) is when you add a few (unused) PHP-extensions? Specially on high-traffic servers, this will have a grave affect.


----------

