leprkhn Posted July 23, 2007 Share Posted July 23, 2007 i installed debian etch on my computer and set up apache2 php5 and mysql on it. everything seems to be working fine except that any php that i place into html file doesn't show up. i put the php inbetween <?php ?> tags. i even tried <script language="php"> </script> tags, and it still doesn't work. im pretty new to php and linux but im a fast learner. if anyone could help me out a bit i'd really appreciate it. is there some .conf file i have to edit? is it a php problem or an apache problem? thanks leprkhn Link to comment https://forums.phpfreaks.com/topic/61442-solved-in-html-doen-not-work/ Share on other sites More sharing options...
simcoweb Posted July 23, 2007 Share Posted July 23, 2007 I'm not familiar with debian etch. I use XAMPP. But, before those tags can work you typically have to place the files in a specific directory on your computer. For XAMPP it's Program Files/XAMPP/htdocs, for example. This may not be the case with your debian etch, though. Link to comment https://forums.phpfreaks.com/topic/61442-solved-in-html-doen-not-work/#findComment-305798 Share on other sites More sharing options...
redarrow Posted July 23, 2007 Share Posted July 23, 2007 you use php as .php and not .html ok correct test.php <?php echo hello; ?> not correct test.html <?php echo hello; ?> Link to comment https://forums.phpfreaks.com/topic/61442-solved-in-html-doen-not-work/#findComment-305799 Share on other sites More sharing options...
teng84 Posted July 23, 2007 Share Posted July 23, 2007 you use php as .php and not .html ok correct test.php <?php echo hello; ?> not correct test.html <?php echo hello; ?> yes. but for some reason using .html read the php file but its better to use .php even in the html file Link to comment https://forums.phpfreaks.com/topic/61442-solved-in-html-doen-not-work/#findComment-305803 Share on other sites More sharing options...
leprkhn Posted July 23, 2007 Author Share Posted July 23, 2007 ok... my document root for apache is /var/www/ and thats where 'localhost' in my browser will go to. inside /var/www/ i have index.html and test.php test.php contains: <? echo ("hello"); $_one=1; $_two=2; $_three=($_one+$_two); print($_three); ?> and when the browser is pointed at localhost/test.php it returns hello3. like it should. however. index.html contains: <html> <head><title>blah</title></head> <body> <p>blah blah blah </p> <?php echo ("hello?"); print ("hello?"); ?> </body> </html> and when the browser is pointed at localhost/index.html it returns: blah blah blah ... and thats it. none of the php gets shown. i dont even know if it's being parsed or just skipped. thoughts? <? Link to comment https://forums.phpfreaks.com/topic/61442-solved-in-html-doen-not-work/#findComment-305804 Share on other sites More sharing options...
teng84 Posted July 23, 2007 Share Posted July 23, 2007 like red arrow told you try .php even if i say html read php the performance using .php i guess is alot better Link to comment https://forums.phpfreaks.com/topic/61442-solved-in-html-doen-not-work/#findComment-305807 Share on other sites More sharing options...
leprkhn Posted July 23, 2007 Author Share Posted July 23, 2007 excelent! i renamed index.html index.php and it works great now. thanks Link to comment https://forums.phpfreaks.com/topic/61442-solved-in-html-doen-not-work/#findComment-305808 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.