Ad

When Installing Just PHP On Windows, All Php Extensions Are Commented Out By Default?

- 1 answer

I'm trying to get Laravel installed and when running composer I get lots of errors along the lines of the requested PHP extension mbstring is missing from your system except there are dozens. It's really tiring going one by one and uncommenting these. What am I doing wrong? Do I need to just install apache(edit: I meant XAMPP) and its default php.ini will have better default options?

Is there a way to get a .ini file that has the most common stuff available? Can I just uncomment all extensions or is there a reason that's a bad idea?

Ad

Answer

Can I just uncomment all extensions or is there a reason that's a bad idea?

Yes, you can uncomment all extensions, but that won't improve your user experience :)

In general: enable only PHP extensions, you really need

The more dynamic extensions PHP needs to load, the more stuff it has to load and process during startup and the more time it takes. So, the startup will be slower.

For instance, enabling the default extension php_pdo_firebird.dll doesn't gain you anything, except, when you really want to access the Firebird database from PHP via PDO.

Is there a way to get a .ini file that has the most common stuff available?

The PHP extensions shipped by PHP itself are all listed in php.ini. There is also php.ini-development with some dev configurations.

If everything is off by default, then i suggest to enable curl + openssl, mysql, sqlite, mbstring for a start, because:

  • Curl and Openssl are needed to get Composer running,
  • Mysql and Sqlite to support these often used databases,
  • mbstring for UTF8 stuff
  • and whenever some library meows enable some more ,)
Ad
source: stackoverflow.com
Ad