Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmyackley35
34,574 PointsPHP syntax in Sublime Text
Hey guys, I'm having a hard time getting Sublime to recognize my php files as actual php files in Sublime Text. The bottom corner of the application window indicates that my files are HTML, however, when I try to reset the syntax to PHP I find that it is already checked.
I've tried installing PHP Modern via Package Manager with no luck and my files appear to be saving correctly with the .php file extension. Do I need to start over on my pages for this project with the appropriate syntax or do I have something wrong with my syntaxes with Sublime?
Thanks!
myackley35
34,574 PointsJenny, I saved my files with a .php extension when I created them, however, my syntax that is set in Sublime may have been set to HTML when I saved them.
Jenny Veens
10,896 PointsSo strange! Just for kicks - Have you tried CMD + shift + p and then Set Syntax : PHP?
myackley35
34,574 PointsIs that more or less equivalent of clicking on the listed syntax and selecting something else at the bottom right of the screen? If so, I've tried it. Regardless, I didn't know you could do that with the Command Palette.
I'm thinking I might have to disable one or both of the syntaxes I have for PHP (PHP and PHP 5.....PHP 5 was installed via PHP Modern) and see if that effects anything.
Jenny Veens
10,896 PointsIt is, but since there is some weirdness I figured it would be worth a try!
myackley35
34,574 PointsThanks, Jenny! I appreciate the help!
Jenny Veens
10,896 PointsOf course! Good luck and let us know if you figure it out :)
myackley35
34,574 PointsThe problem was more or less how my php was formatted and, at the time, I didn't have debug set to true in wp_config.php to be able to properly troubleshoot the problem. I had an extra space at the end of one of my page templates after the closing php tag.
Jenny Veens
10,896 PointsJenny Veens
10,896 PointsHi Mark,
Have you saved your files with a .php extension?