teamtnt / tntsearch

A fully featured full text search engine written in PHP
https://tnt.studio/solving-the-search-problem-with-laravel-and-tntsearch
MIT License
3.08k stars 292 forks source link

sqlite and PHP version installation problem #250

Open syltrinket opened 3 years ago

syltrinket commented 3 years ago

I'm trying to install TNTsearch on a shared server at HostGator. HostGator is forcing us to use PHP7.4 as the default system PHP version, but there is an issue with PHP7.4 requiring a minimum version of SQLite version 3.7 (I think that is right; I'm a noob to this). So, if I run phpinfo from my root directory, I get version 7.4 and no pdo_sqlite or spqite3 extensions referenced.

Cpanel at HostGator allows us to downgrade PHP to 7.3 by domain, which will use the existing SQLite version (3.6). Setting all domain and subdomains to use 7.3 enables pdo_sqlite:

pdo_sqlite PDO Driver for SQLite 3.x enabled SQLite Library 3.6.20

sqlite3 SQLite3 support enabled SQLite Library 3.6.20 Directive Local Value Master Value sqlite3.extension_dir no value no value

I can also run "php -m | grep sqlite3" from my root directory and it does not indicate it is accessible, but from the public_html directory it echoes "sqlite3". However, I can enter sqlite3 CLI from either my root directory or the public_html directory.

Composer is installed in a domain directory (public_html) set to PHP 7.3, but when I try to install TNTSearch with the noted command:

composer require teamtnt/tntsearch

I get the following response:

Problem 1

To enable extensions, verify that they are enabled in your .ini files:

So this is looking at the system installation rather than the version of PHP (which is version 7.4) rather than in the directory. I can't figure out if this is a composer issue or something else I need to change, like instructions for the install command line to specifically install for the php.ini in the target directory.

Sorry if this is a really noobie question! And thanks for any pointers you may have!

ultrono commented 3 years ago

I doubt you'll be able to tweak PHP / server setting from shared hosting. The time I had something similar related to the fact that the PHP cli version within the path variable (i.e. when you type php via the cli) was different. I worked around this by prefixing my composer company command with the required PHP version:

/opt/cpanel/ea-php74... composer install

Cpanel has each version of PHP on the cli set at a specific location, which I'm sure is documented somewhere as I can;t remember the exact path.

In the end though,l I migrated the project to my own server.

syltrinket commented 3 years ago

Hi Ultrono --

Thanks for your response.

I doubt you'll be able to tweak PHP / server setting from shared hosting. The time I had something similar related to the fact that the PHP cli version within the path variable (i.e. when you type php via the cli) was different. I worked around this by prefixing my composer company command with the required PHP version:

/opt/cpanel/ea-php74... composer install

Cpanel has each version of PHP on the cli set at a specific location, which I'm sure is documented somewhere as I can;t remember the exact path.

I thought this might be an option, but couldn't find syntax for how to do that. I believe I can pull the path from the working 7.3 phpinfo, so will try this when I get some time. Thanks for the suggestion!

In the end though,l I migrated the project to my own server.

Yes, I kinda thought that was a possibility. Or find a different way to do what I need to accomplish.

I appreciate your time and comments!