documentation icon indicating copy to clipboard operation
documentation copied to clipboard

PHP: no explaining given why I should thirs or this PHP extenssion

Open PackElend opened this issue 7 years ago • 7 comments

Hallo, I've googled a lot but I'm still not able to say which optional, where multiple choices are given, I shall use. Some guidelines would be helpful. Details are in my post in the Nextcloud forum: Real minimum php requirments and some php mistiness (Would highly appreciated if someone could my answers there).

regards stefan

PackElend avatar Jun 18 '18 14:06 PackElend

Makes sense - I guess we should check the really needed extensions again and add maybe a little text for what it really is needed and if it is mandatory or optional.

MorrisJobke avatar Jun 18 '18 14:06 MorrisJobke

I would appreciate if you discuss that on in my post to share your ideas with the community. We can may cover things in a details what would be too much for the manual and I did some groundwork from what you can may benefit from.

By the way I've learned that the (absolute) minimum is a way less than documented:

  1. curl
  2. GD
  3. openssl
  4. pdo_mysql
  5. zip

PackElend avatar Jun 18 '18 18:06 PackElend

Nextcloud dependency check, during setup-nextcloud.php wizard starting period, says zip, (bzip2) and curl are necessary. My opinion is that if users don't add apps from nextcloud store, zip and bzip2 may not be that crucial. POSIX is listed as one of the prerequisites, but I disabled it and found nothing wrong. It may help the cron/task function.

And PDO, can that be replaced by mysqlnd?

baoang avatar Aug 22 '18 13:08 baoang

thx for the feedback so we may can say

zip optional as long as users don't add apps from nextcloud store bzip2 optional as long as users don't add apps from nextcloud store curl is used to communicate with other servers via URL. You can URL from your code to get a html response but there is certain risk POSIX php.net warns to use it., see #1 and #2

In regard of MySQL, there several ways to communicate with SQL:

mysql mysqli PDO_MYSQL Mysqlnd

I cannot tell what are the pro and cons may after reading and understanding PHP: What is mysqlnd, do I need it? and Overview of the MySQL PHP drivers answer can be given.

PackElend avatar Aug 22 '18 19:08 PackElend

Hi @PackElend & @baoang:

See my response in #783 for posix. And let's close #783 out and keep any follow-up relevant to adjusting the official documentation for PHP extensions in this Issue.

Before I share what I'm thinking of doing to tidy up the PHP extension section a bit I want to call out two things:

  1. Disabling things randomly probably isn't the best approach. 😄 A lot of things will seem fine until you trigger something that depends on an extension that you've disabled. Just disabling and seeing if NC starts isn't a sufficient test. For example, if you disable posix you will trigger exceptions in any of the areas I highlighted in my response to your query in #783 when you go to use them. Fortunately NC is open source so it's easy enough to search the repositories for relevant functions for each module. 😄

  2. Mysqlnd isn't a replacement for pdo_mysql. It replaces the underlying mysql library (provided by MySQL/Oracle) with a native one embedded in/provided by PHP (which all PHP mysql extensions can use instead of requiring MySQL to be installed). pdo_mysql is a dependency and can't just be swapped with mysqli. I suspect PDO is used because it has compatibility with other database backends, which is important to NC (which supports Mysql/MariaDB, PostgreSQL, Oracle DB, SQLite).

Anyhow probably worth an audit of the listed extensions to make sure they haven't gotten out of date in the docs. I also think we can narrow down the current categories (9) to make things clearer. And, sure, we can make sure each listed extension has a purpose/explanation "hint" note of some sort (many currently do and few probably could use some minor updates for clarity).

The streamlining of categories from 9-->4 I'm thinking is as follows:

  • Required:
    • shifting any that aren't truly required down to other categories
    • noting any that are core extensions in PHP that one doesn't generally install or enable separately
    • Move the database connectors here
    • These should be hard failures in the setup and any ongoing checks for these (and in many, perhaps all, cases already are)
  • Possibly Required (depending on use case)
    • This takes over the "Required for specific apps" category
    • Move some of the improperly categorized recommended packages here (like bz2)
    • Noting use case so reader can make an informed decision
    • These should be checked for and warned about at setup and upgrade time
  • Recommended for additional functionality
    • This takes over the "Recommended for specific apps (optional)" category
    • Move the "preview generation (optional)" entries here
    • Add better explanations for the preview generation items
    • Move the "command line processing (optional)" entry here
    • Move the "command line updater (optional)" entry here
    • (i.e. we never hard fail when these are missing, but simply enable less functionality)
  • Recommended for enhanced performance
    • Move the memcaches here
    • Move intl here, but also include it in the above category (with an explanation - since it has two drivers for installation)
    • (i.e. we never hard fail when these are missing, but simply enable less functionality)

A note maybe added that it's a good idea to monitor this list for changes before upgrading - to avoid breaking behavior - since required extensions change from time to time.

Also, now that I'm looking at the doc I'm reminded of something else I wanted to fix in the paragraph that introduces the current PHP extension list:

The Nextcloud .tar archive contains all of the required PHP modules. This section lists all required and optional PHP modules. Consult the PHP manual for more information on modules. Your Linux distribution should have packages for all required modules.

That first sentence is misleading/ambiguous.

FIXME: SQLite should be added to the db connector list

joshtrichards avatar May 26 '23 21:05 joshtrichards

thanks for coming back on this. It sounds like a way forward to me 😃

PackElend avatar May 28 '23 17:05 PackElend

PHP chapter was recently rewritten in #13573. An initial version has been released in the upcoming v32 documentation:

https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html

joshtrichards avatar Sep 23 '25 02:09 joshtrichards