Eclipse PHP PHPUnit - Eclipse use the wrong php.ini file

后端 未结 1 984
孤街浪徒
孤街浪徒 2021-01-15 17:10

I try to use PHPUnit and each time when I load the tests the php.ini file loaded is this one :

C:\\Users\\Jerome\\AppData\\Local\\Temp\\zend_debug\\se

相关标签:
1条回答
  • 2021-01-15 17:51

    This is normal behavior of PDT. PDT with Xdebug creates two copies of the specified PHP ini file into your temporary directory when launching a script. The first one is the same as the specified PHP ini file. The second one is what is really used for the launch.

    In the second one, the include_path field is always removed. Additionally some fields are added into the bottom of the file as follows:

    --- /path/to/specified/php.ini
    +++ /path/to/temp/zend_debug/session2594175249121649690.tmp/php.ini
     ;;;;;;;;;;;;;;;;;;;
    @@ -785,7 +786,6 @@
     ;;;;;;;;;;;;;;;;;;;;;;;;;
    
     ; UNIX: "/path1:/path2"
    -include_path = "..."
     ;
     ; Windows: "\path1;\path2"
     ;include_path = ".;c:\php\includes"
    @@ -1852,3 +1852,6 @@
     ; Local Variables:
     ; tab-width: 4
     ; End:
    +
    +date.timezone= "Asia/Tokyo"
    +memory_limit = "256M"
    

    How to solve the include_path for launching?

    Basically, the PHP Include Path property is used to solve dependencies for a project. Especially, PHPUnit is solved by a user library which is defined in the workspace preferences. See the following images.

    Configuring PHP Libraries

    Using PHP Libraries in PHP Include Path

    0 讨论(0)
提交回复
热议问题