PHP GTK module in php.ini

前端 未结 3 1273
傲寒
傲寒 2020-12-21 22:38

I installed PHP GTK in C:\\php-gtk but when I go to run it like from the command line like this

cd C:\\php-gtk2
php demos\\phpg         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-21 22:52

    you can take it a bit further, and not worry about paths, I work in Windows environment and I use relative paths even inside .ini like this:

    extension_dir = "ext"
    extension = php_cairo.dll
    extension = php_mongo.dll
    

    This allows me to move the php-gtk folder anywhere.

    As for running my projects I do a similar thing, I create .cmd files like this:

    "%CD%\..\..\PhpGtkRuntime\php.exe"  "%CD%\index.php"
    

    So you can have for example a central folder and in a subfolder goes php-gtk and in an other one all you projects like this:

    php-gtk/PhpGtkRuntime 
    php-gtk/Projects
    

    The whole idea is that I distribute a folder to the final user with a run.cmd inside it and the user does a simple copy paste of the folder, really nothing else. I have made an example package with MongoDB included and all of it is portable even MongoDB, Check here..

提交回复
热议问题