php does not activate

Alles, was PHP betrifft, kann hier besprochen werden.

php does not activate

Postby Coastalguy » 19. June 2014 00:41

I have been using Xampp on my computer that just crashed. I just installed it on a new computer and copied all of my website files to a folder, which I have activated for localhost on htdocs Document Root and <Directory....">. http://localhost finds my files fine and displays the html part, but all of the php code appears on the display. I have created a test with both html and php for a string and only the html string appears. On the control panel, but apache and mysql load fine with no errors. Entering http://localhost/ displays a page but not the apache orange page. Instead is displays some lines saying that if the phpinfo() code below displays all of the settings, php is working, however all I get is the phpinfo() code and nothing else. I have tried 127.0.0.1, however this ip brings up my Visa Versa backup control panel, which obviously was previously assigned this ip address. However, I had the same setup on my old PC, and this was not a problem. Can someone advise me how to activate php, as I am at a loss on this install. Having installed it about 5 times previously, I never had this problem. Thanks,
Coastalguy
 
Posts: 57
Joined: 06. March 2011 21:06
XAMPP version: 1.7.7
Operating System: Windows 10 Home Premium

Re: php does not activate

Postby JJ_Tagy » 19. June 2014 01:17

Are you using short open tags?
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: php does not activate

Postby Coastalguy » 22. June 2014 18:27

Usually short tags, however I created a test file using both short and long tags, but it still did not show the strings within either php tags. Having to set up another install of windows, I just install Xampp there also, and the same problem exists. I changed the config DocumentRoot and <Directory..> to where my web files are, but nothing else. My web files open with localhost, but again, where there is php code, the code displays and not the results of the code?
Coastalguy
 
Posts: 57
Joined: 06. March 2011 21:06
XAMPP version: 1.7.7
Operating System: Windows 10 Home Premium

Re: php does not activate

Postby Altrea » 22. June 2014 20:09

We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: php does not activate

Postby Coastalguy » 23. June 2014 04:08

Viewed your link and not sure what resolution you are specifying? Again, I set up a test php file with <?php.....?> tags and it did not recognize this long tag. I have installed Xampp a number of times, last version 1.7.7, and never had this problem. I guess I'll go back to this version, considering it doesn't look like there is a real solution for 1.8.3.....
Coastalguy
 
Posts: 57
Joined: 06. March 2011 21:06
XAMPP version: 1.7.7
Operating System: Windows 10 Home Premium

Re: php does not activate

Postby Nobbie » 23. June 2014 09:05

You should go step by step:

a) install Xampp

b) run http://localhost and look if PHP is activated

c) THEN copy all your files to the desired folder (nothing more), run localhost again

d) apply changes to Apache configuration like you did before (DocumentRoot etc.), then try again.


Otherwise we will not find out what causes the problems. I believe that you either did a mistake when changing Apache configuration, or you have a .htaccess inside your localhost which comes with your files and what changes "something" (for example, apply a different AddType Clause for PHP files).
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: php does not activate

Postby Altrea » 24. June 2014 06:54

Coastalguy (by email) wrote:Altrea,

I am truly sorry on my test. I had a space between <? and php, [ <? php ], which when removed [ <?php ], the php string and the phpinfo() displayed.

Now my problem is that I have so many php instances that start with <?, is there a way to set php to acknowledge the short tag also, until I am able to change them all over to the long tag?

Thanks


There is a way to activate short open tag by the short_open_tag setting in your php.ini.
But i would not recommend this. I would use an competitive text editor (like Notepad++) to search and replace beyond file boundaries string "<? " to "<?php "
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to PHP

Who is online

Users browsing this forum: No registered users and 10 guests