1

Trying sublime3 (unregistered demo) today and really liking the workflow much better then dreamweaver but keep getting T_CONSTANT_ENCAPSED_STRING errors on my production LAMP server, but not my local MAMP testing server (using Filezilla for SFTP to lamp server)

I deleted everything in both of these test files, retyping(not copy and pasting) into each file only this... (using sublime)

UnitTest.php

<?php 
require_once ('dbentity.class.php');
?>

dbentity.class.php

<?php
echo "hello";
?> 

or im getting the T_CONSTANT_ENCAPSED_STRING error

but if dbentity.class.php is

hello

(no php tags) I do get the result of "hello" being printed into the browser.

This is totally stumping me I've checked the character encoding(UTF-8) and chmod (644) so that doesn't seem to be the problem. I've been developing in dreamweaver for about 2 years and haven't run into this problem, my best guess is that sublime is creating gremlins, but I know lots of PHP developers that use sublime...

4

1 回答 1

2

除了编码和 chmod 之外,您应该检查的一件事是行尾,我从来没有偶然发现它们有问题,但我知道有些人有。

在 Sublime 中,转到View->Line endings并将它们设置为Unix.

我一直将它们设置为 Unix,并且在任何语言、任何语言解释器/编译器和操作系统方面都没有任何问题。

于 2013-09-23T13:54:17.860 回答