Intermittent PHP syntax highlighting issue


Still getting same issue in Atom 1.0.

But I wondering why sometimes it works and something doesn’t :frowning:

PHP syntax not being highlighted

What issue is that? As far as I can tell this is your first post.


The above was a theme issue related to Atom Dark. If you’re seeing the same thing, can you switch the theme and see if that fixes it?
If it’s not the same thing, could you open a new thread, or better yet an issue on the relevant repo?


I mean, I’m using Atom 1.0 with One Dark theme and occasionally php syntax is not being highligted


It sounds like it isn’t the same issue as what you were replying to. It sounds like what you’re running into is this known issue:


Yes it is.

I’ve tried using monokai, but like I said it sometime not being highlighted. See it doesn’t work

But, after trying to restart and it works :sweat:

What’s the real problem here…?


I don’t know … is it being recognized as PHP? The Settings View was focused, so I couldn’t see the grammar selector in your screenshot.


Yes! it recognized as PHP. Sorry for the focus…

Just try to restart it again and not working again :sweat_smile:


Can you try completely exiting Atom and starting it in Safe Mode using atom --safe?


Tried 5x times and it seems works using atom --safe

So, what’s the problem?


That means that some other package you have installed is breaking the PHP syntax highlighting.


Well, I’ll try to resintall it and will give result each time i install a plugin.


You can disable packages too instead of uninstalling them.


I know, but I love my way :smile:


It will really depend on which package is messing with you here.
Could it be you have two packages installed that interfere with each other, e.g. both trying to do something with the PHP file syntax or something?


I found it! Plugin that causing this problem is language-vue-component.

Thanks for advising me guys. :smile:

Edit: typo (I have poor english btw) :sweat_smile:


I’m facing this intermittent PHP syntax highlighting issue too.

I’m using v1.0.0. with the default “one dark” theme. I’ve not installed any packages.

Contrary to what has been said elsewhere in this forum, PHP syntax highlighting is NOT dependent on:

  1. the presence of <!DOCTYPE> or any other HTML in the file
  2. restarting Atom
  3. starting Atom in --safe mode

Can someone provide a definitive answer for what is going on here?


I figured it out. Some of my .php files always got syntax highlighting, and others pretty much never did. The ones that didn’t work didn’t have <?php ?> at the top of the page. You don’t need to put any PHP in the tags but make sure the tags are there before and it’ll work every time! :smile:


Make sure you have PHP tags at the top of your page before even if they’re empty. Just this: <?php ?> is all you need to make sure it highlights all your PHP.