[mapguide-users] MGOS 4.0 and REST
pierre.cardinal at sympatico.ca
pierre.cardinal at sympatico.ca
Mon Aug 15 16:48:20 PDT 2022
The DLL for XDEBUG are at https://xdebug.org/download/historical
De : mapguide-users <mapguide-users-bounces at lists.osgeo.org> De la part de pierre.cardinal at sympatico.ca
Envoyé : 3 août 2022 21:17
À : 'MapGuide Users Mail List' <mapguide-users at lists.osgeo.org>
Objet : Re: [mapguide-users] MGOS 4.0 and REST
Hi Jackie,
Debugging PHP under VSCode with Xdebug 2 :
* Windows 10 with IIS (regular installation for MapGuide Web Tier)
* PHP 5.6.40
* dll for xdebug 2 : D:\mgos\Web\Php\ext\php_xdebug-2.5.4-5.6-vc11-x86_64.dll
* php.ini config for xdebug 2 :
[XDebug]
zend_extension = "D:\mgos\Web\Php\ext\php_xdebug-2.5.4-5.6-vc11-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
* installation of the PHP Xdebug extension in VSCode :
PHP Debug from Robert Lu
https://marketplace.visualstudio.com/items?itemName=robberphex.php-debug
* modification json user parameter in VSCode
* {
* "php.validate.executablePath": "D:/mgos/Web/Php/php.exe"
* }
* open the file D:\mgos\Web\www\rest\index.php with vscode
* add a breakpoint to a line of index.php
* click on the bug icon on the left of the VSCode window
* click on the green arrow next to « Listen for XDebug » at the top of the VSCode window
* in your browser execute http:// <http://%3cservername%3e/maguide/rest/index.php> <servername>/maguide/rest/index.php
* in vscode the debugger will stop at the first line with a breakpoint
* now you should be in business
note : The configuration for php.ini is different for Xdebug 3 (PHP 8).
Don’t forget the FastCGI delay when debugging.
Some references :
https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug
https://docs.devsense.com/en/vs/debugging/configuring-xdebug
https://code.visualstudio.com/docs/languages/php
Hope it helps
Question from my side
Where is the code for MGOS 4.0.0 preview 3. Is it under SVN https://trac.osgeo.org/mapguide/browser/trunk/MgDev or is it under GitHub mapguide/MgDev at master · jumpinjackie/mapguide · GitHub <https://github.com/jumpinjackie/mapguide/tree/master/MgDev> ? What is the difference between both ?
Regards,
Pierre
De : mapguide-users <mapguide-users-bounces at lists.osgeo.org <mailto:mapguide-users-bounces at lists.osgeo.org> > De la part de Jackie Ng
Envoyé : 3 août 2022 13:32
À : mapguide-users at lists.osgeo.org <mailto:mapguide-users at lists.osgeo.org>
Objet : Re: [mapguide-users] MGOS 4.0 and REST
mapguide-rest has not been maintained for years now due to competing priorities in real life and on other projects.
I am assuming by MGOS 4.0 you are using the current preview 3 release. If you are using my vanilla SWIG sandbox branch then I can say mapguide-rest will definitely not work right now as that is still targeting PHP 5.6 and the vanilla SWIG branch now bundles PHP 8.
Assuming you are on the preview 3 release that still bundles PHP 5.6, then if you are using the 1.0 RC5 release I can say that release will not work because it has a class that collides with a class of the same name in the MapGuide API (MgGeoJsonWriter). All I can say is try building mapguide-rest from git master (which renames this conflicting class) and see if that works with your preview 3 installation.
Otherwise I would just hold off on trying to use mapguide-rest with MGOS 4.0. The next preview release of MGOS 4.0 when it drops, will ship with PHP 8.1, which means mapguide-rest will *definitely* not work for reasons already stated above. There will need to be dev work (which I currently do not have time for) to migrate mapguide-rest over to PHP 8.1. So all things considered mapguide-rest will not be usable with MGOS 4.0 in the foreseeable future until at least the final release of MGOS 4.0 is out the door. Only then can I reasonably invest some time into migrating over mapguide-rest.
As an aside, I am also interested in how you set up your VSCode for PHP debugging. I only got this to work for debugging PHP scripts that are run from the command-line. I never got this to work for PHP code running on a web server.
- Jackie
You wrote:
Hi Jackie,
What can it be ?
MGOS 4.0 from last release with IIS under Server2012 R2
MGOS 4.0 from build with IIS under Win10
When I tried to use mapguide-REST with
<http://localhost/mapguide/rest/index.php> http://localhost/mapguide/rest/index.php, I have the following message :
404 Page Not Found
The page you are looking for could not be found. Check the address bar to
ensure your URL is spelled correctly. If all else fails, you can visit our
home page at the link below.
Visit the Home Page < <http://localhost/mapguide/rest/index.php/> http://localhost/mapguide/rest/index.php/>
And in the VS Code debugger I have the exception Slim\Exception\Stop (line
1020 in Slim.php)
--
Please Note: I no longer create new posts or post replies to any OSGeo mailing list through nabble. As a result, you most likely won't see this message appear on nabble's view of any OSGeo mailing list and may only see this message through mailing list archives or depending on your mailing list subscription settings, through daily message digests or automated notifications from the mailing lists.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20220815/31d8d5bf/attachment.htm>
More information about the mapguide-users
mailing list