microsoft / php-sdk-binary-tools

Tool kit for building PHP under Windows
BSD 2-Clause "Simplified" License
270 stars 79 forks source link

when a path is contains blank spaces,bat execution failure #81

Closed tyonly closed 2 years ago

tyonly commented 2 years ago

a file path include blank spaces .example: c:\program files\ execute "phpsdk-vc15-x64.bat"

error message: 不是内部或外部命令,也不是可运行的程序

cmb69 commented 2 years ago

I'm not sure it would make sense to fix that; there may be more issues with spaces in the path (AFAIK, php-src can't handle these either). Furthermore, it is suggested to install the PHP SDK binary tools in the shortest possible path.

tyonly commented 2 years ago

OK,I change my clone folder to f:\sdk , no longer contains spaces

pierrejoye commented 2 years ago

also it could use the bat macro to replace the path with the 8.3 format.

On Fri, Dec 31, 2021, 8:35 PM tyonly @.***> wrote:

OK,I change my clone folder to f:\sdk , no longer contains spaces

— Reply to this email directly, view it on GitHub https://github.com/microsoft/php-sdk-binary-tools/issues/81#issuecomment-1003378788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACE6KEZGPVXRVDEYL6TRVLUTWWTHANCNFSM5K7F7CLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

tyonly commented 2 years ago

the path with the 8.3 format.

I clone the git zip to a path like: d:\abc d\01 aa\03 dd\, then execute : phpsdk-vc15-x64.bat ,it display errors. then I follow cmb69's suggest ,change my foloder path, then it works. tks all

pierrejoye commented 2 years ago

What I mean is using %%~sf macro to transform the "c:\path with some\spaces" to the 8.3 format.

for example:

C:\>cd "\Program Files"
C:\Program Files>for %f in ("%cd%") do @echo %~sf
C:\PROGRA~1

can be used in variables etc.

Now, that will work too if the transformed path is used in all include paths and co.