I created a new shape file object within php_mapscript and got the error below. I tested with MapServer 5.2.0 beta2, beta 3 and trunk on Ubuntu. It doesn't happen with 5.0.2 release. I pasted below the script used for the test.
[02-Jul-2008 15:27:21] PHP Warning: [MapServer Error]: msNewSHPFile(): (ttt)
in /home/nsavard/fgs-ms5.2.0.beta3/www/htdocs/createshp.phtml on line 9
[02-Jul-2008 15:27:21] PHP Warning: [MapServer Error]: msSHPOpen(): Corrupted .shp file : nRecords = -12.
in /home/nsavard/fgs-ms5.2.0.beta3/www/htdocs/createshp.phtml on line 9
[02-Jul-2008 15:27:21] PHP Fatal error: Failed to open shapefile ttt in /home/nsavard/fgs-ms5.2.0.beta3/www/htdocs/createshp.phtml on line 9
and the script is:
<html>
<body>
<?php
dl("php_mapscript.so");
$shpFname = "ttt";
$shpFile = ms_newShapeFileObj( $shpFname, MS_SHP_POINT );
?>
</body>
</html>