Support for project-specific PHP ini locations

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Support for project-specific PHP ini locations

Postby alex » March 13th, 2017, 9:52 am

Hi,

I'm looking into configuring the php.ini location in a project-specific manner.
We have a small team all using PHPtools but when we change PHP ini parameters it's always a pain to get everyone updated with the new ini file.
Since our php.ini file for dev environment is checked in without our source code, it would be a lot easier if we could configure PHPTools to use this ini file instead of the one under C:\Program files\...

Right now we're using IIS Express and PHP 5.6 (moving to 7.0).
It seems PHPTools generates an application.config in the Documents folder of the current user.
In that config the PHPRC envrionment variable is defined as follows:
Code: Select all
<fastCgi>
            <application fullPath="C:\Program Files (x86)\IIS Express\PHP\v5.6\php-cgi.exe" monitorChangesTo="C:\Program Files (x86)\IIS Express\PHP\v5.6\php.ini" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
                <environmentVariables>
                    <environmentVariable name="PHPRC" value="C:\Program Files (x86)\IIS Express\PHP\v5.6\" />
                    <environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
                </environmentVariables>
            </application>
            <application fullPath="C:\Program Files (x86)\IIS Express\PHP\v7.0\php-cgi.exe" monitorChangesTo="C:\Program Files (x86)\IIS Express\PHP\v7.0\php.ini" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
                <environmentVariables>
                    <environmentVariable name="PHPRC" value="C:\Program Files (x86)\IIS Express\PHP\v7.0\" />
                    <environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
                </environmentVariables>
            </application>
        </fastCgi>


If I change the PHPRC value to my local workspaces php.ini location, this seems to work fine.
However, this local workspace will have another name on my colleagues workstations. Also this application.config file is not part of the project, so changing it will not automatically update my colleagues configurations.

So I think to really get this to work, we need some kind of support for this from the PHPTools plugin.
Is this something that can be investigated?
alex
 
Posts: 1
Joined: March 13th, 2017, 9:02 am

Re: Support for project-specific PHP ini locations

Postby Jakub Misek » March 15th, 2017, 12:26 pm

Hi Alex,

Sorry for the delay.

For such cases, it is recommended to put shared and source controlled INI directives in special `.user.ini` file in root of your web (see attachement).

This functionality is described at http://php.net/manual/en/configuration. ... r-user.php

In this way, when running using IIS/IIS Express, PHP automatically gets additional INI directives from `.user.ini` file and developers can keep it in sync and source controlled.

I hope it helps, Please let me know if it works for you.

Thanks,
Jakub
You do not have the required permissions to view the files attached to this post.
Jakub Misek │ DEVSENSE s.r.o. │ Email: jakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2058
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 4 guests

cron

User Control Panel

Login

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 4 guests
Phalanger