Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix requirement name on setup screen #706

Merged
merged 2 commits into from
Nov 1, 2023
Merged

Conversation

chrissawyerfan4
Copy link
Contributor

I was confused, while doing a new setup, about apt install php-pdo saying it's already satisfied:

$ apt install php-pdo
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'php8.2-common' instead of 'php-pdo'
php8.2-common is already the newest version (8.2.7-1~deb12u1).
php8.2-common set to manually installed.

The command phpenmod pdo also ran fine, yet the page still complained that PDO is missing. Diving into the source code, I find:

app/Http/Controllers/Setup/RequirementsController.php

    protected function checkRequirements(): array
    {
        $results = [
            'php_version' => PHP_VERSION_ID >= 70400,
            'extension_bcmath' => extension_loaded('bcmath'),
            'extension_ctype' => extension_loaded('ctype'),
            'extension_json' => extension_loaded('json'),
            'extension_mbstring' => extension_loaded('mbstring'),
            'extension_openssl' => extension_loaded('openssl'),
            'extension_pdo_mysql' => extension_loaded('pdo_mysql'),
            'extension_tokenizer' => extension_loaded('tokenizer'),
            'extension_xml' => extension_loaded('xml'),
            'env_writable' => File::isWritable(base_path('.env')),
            'storage_writable' => File::isWritable(storage_path()) && File::isWritable(storage_path('logs')),
        ];

        $success = !in_array(false, $results, true);

        return [$success, $results];
    }

The requirement being checked for is pdo_mysql rather than generic pdo. Indeed, apt install php-pdo-mysql + phpenmod pdo_mysql + systemctl restart apache2 worked.

I'd propose to update the translations to match what people need to install. If you agree with the change, the markdown documentation should also be updated.

@Kovah Kovah merged commit f734547 into Kovah:dev Nov 1, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants