0

I am new to Twitter Bootstrap and I included some simple PHP script to test and my browser (Chrome) won't read the php code. I have saved the file .html, .php, and tried .html.php. Is it that Twitter Bootstrap only works with client side, not server side apps, or is there a trick to get it to work with PHP? Thanks

3 Answers 3

10

Does Twitter Bootstrap work with PHP?

Yes and no.

Bootstrap is entirely client side. It can be output by PHP (just like any other client side code) but has no special features for interacting with it.

my browser (Chrome) won't read the php code

PHP is a server side language. No browser parses PHP code. You need to access it through a web server that will execute the PHP and return the output to the browser. See also installing PHP.

2
  • Thank you for clarifying what I was trying to say. I am running wampserver and my install is working fine, apache is reading the php but as soon as i include something as simple as "Hello World" in php within on the same page (Notepad++) as references to twitter bootstrap, buttons and forms and so forth, i only see the twitter-bootstrap stuff, no php code. Jul 17, 2012 at 16:15
  • Make sure you have set some sort of padding-top, say 60px, for the body as your content may be hidden under the bootstrap navbar. Jul 18, 2012 at 13:19
5

Bootstrap is just some css and javascript. You can use it with a PHP app just fine. We do.

1
  • I suspect rikh means that you can write a PHP app that outputs HTML based on Twitter Bootstrap.
    – Quentin
    Jul 17, 2012 at 16:18
0

Use Microsoft WebMatrix 3 (installing php and Wamp servers is really very annoying)

Use Webmatrix IDE and then php and bootstrap will work just fine..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.