vekien / QueriaTMX

A tool to parse TMX files and provide a simple searchable UI.
10 stars 2 forks source link

Setup in portable/dev server environment? #1

Closed ahbic closed 1 year ago

ahbic commented 1 year ago

This is cool, thank you!

Do you know how to get this running in a xampp or easyphp style environment? I'm used to just putting a folder into htdocs/ and index.php takes care of the rest.

vekien commented 1 year ago

Hello! This should be quite doable, I will write up a guide on getting it started using xampp, it basically needs an apache entry and then you can use the "Shell" for running the import commands.

I'll get a guide up this weekend for XAMPP :)

vekien commented 1 year ago

Hello, I was having some problems with Apache2, I'm more of an nginx guy! I got to this stage:

  1. Open the httpd.conf file located in xampp/apache/conf/

  2. Find the line that starts with DocumentRoot and change it to point to the queriatmx/public directory:

    DocumentRoot "C:/xampp/htdocs/queriatmx/public"
  3. Find the block that corresponds to the DocumentRoot and make sure that it has the following settings:

<Directory "C:/xampp/htdocs/queriatmx/public">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
</Directory>
  1. Save and close the httpd.conf file.
  2. Restart the Apache server.

However to simplify the setup of this project I have included PHP and all required libraries, if you check the README there is a simple process to get going :)

https://github.com/vekien/QueriaTMX

ahbic commented 1 year ago

Without updating, I got this:

Warning: require(C:\dev\xampp\htdocs\QueriaTMX/vendor/autoload.php): Failed to open stream: No such file or directory in C:\dev\xampp\htdocs\QueriaTMX\config\bootstrap.php on line 5

Fatal error: Uncaught Error: Failed opening required 'C:\dev\xampp\htdocs\QueriaTMX/vendor/autoload.php' (include_path='C:\dev\xampp\php\PEAR') in C:\dev\xampp\htdocs\QueriaTMX\config\bootstrap.php:5 Stack trace: #0 C:\dev\xampp\htdocs\QueriaTMX\public\index.php(7): require() #1 {main} thrown in C:\dev\xampp\htdocs\QueriaTMX\config\bootstrap.php on line 5

after updating I got a pretty but noninformative:

Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

Upon refresh, I could see at the top also:

Deprecated: Symfony\Component\HttpKernel\Debug\FileLinkFormatter implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in C:\dev\xampp\htdocs\QueriaTMX\vendor\symfony\http-kernel\Debug\FileLinkFormatter.php on line 24

I then tried the method with php included which resulted in:

PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: C:\Program Files\php74\ext\curl (The specified module could not be found.), C:\Program Files\php74\ext\php_curl.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd2' (tried: C:\Program Files\php74\ext\gd2 (The specified module could not be found.), C:\Program Files\php74\ext\php_gd2.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'imap' (tried: C:\Program Files\php74\ext\imap (The specified module could not be found.), C:\Program Files\php74\ext\php_imap.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring' (tried: C:\Program Files\php74\ext\mbstring (The specified module could not be found.), C:\Program Files\php74\ext\php_mbstring.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl' (tried: C:\Program Files\php74\ext\openssl (The specified module could not be found.), C:\Program Files\php74\ext\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: C:\Program Files\php74\ext\pdo_mysql (The specified module could not be found.), C:\Program Files\php74\ext\php_pdo_mysql.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: C:\Program Files\php74\ext\pdo_sqlite (The specified module could not be found.), C:\Program Files\php74\ext\php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: C:\Program Files\php74\ext\curl (The specified module could not be found.), C:\Program Files\php74\ext\php_curl.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: C:\Program Files\php74\ext\gd2 (The specified module could not be found.), C:\Program Files\php74\ext\php_gd2.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'imap' (tried: C:\Program Files\php74\ext\imap (The specified module could not be found.), C:\Program Files\php74\ext\php_imap.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: C:\Program Files\php74\ext\mbstring (The specified module could not be found.), C:\Program Files\php74\ext\php_mbstring.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: C:\Program Files\php74\ext\openssl (The specified module could not be found.), C:\Program Files\php74\ext\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: C:\Program Files\php74\ext\pdo_mysql (The specified module could not be found.), C:\Program Files\php74\ext\php_pdo_mysql.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: C:\Program Files\php74\ext\pdo_sqlite (The specified module could not be found.), C:\Program Files\php74\ext\php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0
Importing TMX files...

In AbstractSQLiteDriver.php line 86:
                                                          
  An exception occurred in driver: could not find driver  
                                                          

In Exception.php line 18:
                         
  could not find driver  
                         

In PDOConnection.php line 40:
                         
  could not find driver  
                         

parse_tmx [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

I then tried using php's exe:

 $ ../xampp/php/php.exe -d memory_limit-1 bin/console parse_tmx
PHP Deprecated:  Symfony\Component\HttpKernel\Debug\FileLinkFormatter implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in C:\dev\QueriaTMX\vendor\symfony\http-kernel\Debug\FileLinkFormatter.php on line 24

Deprecated: Symfony\Component\HttpKernel\Debug\FileLinkFormatter implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in C:\dev\QueriaTMX\vendor\symfony\http-kernel\Debug\FileLinkFormatter.php on line 24
Importing TMX files...
0 imported tmx files.

Not sure what to do from there.

vekien commented 1 year ago

Hello!

My apologies, I had modified the php.ini to point to some stuff on my PC, I have pushed a fix so that it should now load extensions from the included one, if you redownload you should be able to rerun .\php/php.exe -d memory_limit-1 bin/console parse_tmx and .\php\php.exe -S localhost:8000 public/index.php

This should fix the An exception occurred in driver: could not find driver as it's now correctly loading extensions from the included folder: https://github.com/vekien/QueriaTMX/tree/main/php/ext

The deprecations shouldn't matter, I can fix them at some point (though i don't get them, weird!)

Let me know how you get on with updated code I've pushed!

ahbic commented 1 year ago

It actually runs now, thanks!