Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Include: Long Path Issue

Tags:

include

php

When I try to include a long file path the PHP include fails to load. A short include path works fine.

For example, the following will fail:

../../contents/2010-St-Louis-Rams-Tickets-Season-Package-Includes-Tickets-For-All-Regular-Season-Home-Games/inc/title.inc

Does anyone have any idea where the problem could be?

like image 423
Imran2220 Avatar asked Nov 14 '22 13:11

Imran2220


1 Answers

Please check if your path (including drive name etc) exceeds 260 characters. Because that's the maximum directory length for Windows. Click here to see the reference.

The reference also states that there is the possibility to create extra-long path names by prepending the path name with "\?\". That should expand the maximum path length to 32767 characters. But I have no idea if this can be used within PHP.

like image 194
Carsten Avatar answered Nov 16 '22 04:11

Carsten