[solved]Parse error: syntax error in \xampp\lang\en.php l.60

Problems with the Windows version of XAMPP, questions, comments, and anything related.

[solved]Parse error: syntax error in \xampp\lang\en.php l.60

Postby hanpedro » 16. December 2011 15:32

I got an error at "http://localhost/xampp/index.php" on xampp 1.7.7 for windows.

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in \xampp\lang\en.php on line 60


The 60 line of "\xampp\lang\en.php" is this.
Code: Select all
   $TEXT['status-php'] = "PHP";


Please let me know how to resolve this problem.
hanpedro
 
Posts: 133
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby Sharley » 16. December 2011 23:56

I have the exact same line in my 1.7.7 installation that is not giving an error and if I go back to 1.6.8 and check that line in each version I find they are all the same and give no error.

In fact all the lines in that section of the en.php file are constructed in the same way and should therefore give the same error message.

I am not sure what is going on or if you have edited that file at some stage or saved it - some editors add hidden characters when saved not as pure text and best to use a dedicated code editor for php and not the Windows notepad (in notepad you can Save as.. Any file (*) and then add the file name en.php manually).

To check that you have an original content file you could try downloading the zip or 7zip version and drag the en.php file from the archive by overwriting the original (or perhaps better still rename the original first to en_orig.php or making a Copy of en.php then the 2 files can be compared for the error message).

Using the error message as a defined keyword in Google then there are many results but none that I could see that relate to the line in the en.php file.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby hanpedro » 17. December 2011 04:03

Sharley/

I chnged the xampp folder fof "http://localhost/xampp" from "d:\xampp\htdocs\xampp" to "d:\_web\xampp", and I edited "d:\xampp\apache\conf\extra\httpd-xampp.conf" as this.

Code: Select all
<Directory "d:/_web/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>
hanpedro
 
Posts: 133
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby Sharley » 17. December 2011 05:25

hanpedro wrote:Sharley/

I chnged the xampp folder fof "http://localhost/xampp" from "d:\xampp\htdocs\xampp" to "d:\_web\xampp", and I edited "d:\xampp\apache\conf\extra\httpd-xampp.conf" as this.

Code: Select all
<Directory "d:/_web/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>
Did you physically move the xampp folder from it's old location to the new location or did you copy it leaving the original xampp folder in place?

If you moved the xampp folder then you need to add an Alias to the above code sample and move so it is the first section below the <IfModule alias_module> directive like so
Code: Select all
<IfModule alias_module>
Alias /xampp "D:/_web/xampp"
<Directory "D:/_web/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>
You will see after your Alias /xampp entry the other Alias directive entries.

Save the file and restart Apache then go to http://localhost/xampp/index.php and you should see the Welcome page again.

I can't relate the above moving of the D:\xampp\htdocs\xampp folder to a new location has anything to do with your original error message.

I replicated your moving of the xampp folder and there was no syntax error produced which may be caused by the addition of some hidden characters from a text editor.

Did you try the zip download technique to replace the en.php file in the D:\_web\xampp\lang folder?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby hanpedro » 19. December 2011 05:02

Sharley/

Thanks for your kind instruction, but "<IfModule alias_module>" of httpd.conf is different.

at 307 line of httpd.conf:

Code: Select all
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "d:/apm_packages/xampp/cgi-bin/"
</IfModule>


at 66 line of extra/httpd-xampp.conf:

Code: Select all
<Directory "d:/apm_packages/xampp/htdocs/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>


And I changed 307 line of httpd.conf as this:

Code: Select all
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "d:/apm_packages/xampp/cgi-bin/"
Alias /xampp "d:/_web/xampp"
<Directory "d:/_web/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>
</IfModule>


And I've moved from "d:\xampp\htdocs\*" to "d:\_web\xampp\*".

But when I try to open "http://localhost:8080/xampp", it does not show.
Strangely, "http://localhost:8080/phpmyadmin/" is opened.
hanpedro
 
Posts: 133
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby Sharley » 19. December 2011 05:34

Why are you changing things when you have no idea what you are doing. :shock:

You do not change the cgi-bin alias in the httpd.conf file, so put it back to how it was, please or you will just create more issues for the support staff to solve for you.

Line 66 in the httpd.xampp.conf file has nothing to do with the path to the cgi-bin in the xampp installation folder on line 307 of the httpd.conf file, it is referring to a completely different path and location.


The entries in the httpd.conf file are over ruled by those in the extra folder conf files.

First Apache reads the httpd.conf file then reads those in the extra folder and uses the settings found in the extra folder if they are different to the ones in the httpd.conf file.


You add your Alias in the httpd-xampp.conf file like I suggested in my post above.

You do not add it to another container already created especially in the httpd.conf file ( I did not ever suggest you do that and in no way could my post above have been misunderstood to give you ideas for you to do that ),

You make your own Alias container as outlined in my post above or created a separate container like below in the httpd-xampp.conf file ONLY
Code: Select all
<IfModule alias_module>
Alias /xampp "D:/_web/xampp"
<Directory "D:/_web/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>
</IfModule>
It must be a container all of it own not included in any another container.


Please try and follow what is being posted or we will only end up going backwards instead of moving forward with solutions that work not ones that will only create more problems.

Good luck. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby hanpedro » 19. December 2011 05:55

Sharley/

I restored httpd.conf to original state, and changed httpd-xampp.conf to your instruction:

Code: Select all
<Directory "d:/apm_packages/xampp/htdocs/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>

<IfModule alias_module>
Alias /xampp "d:/_web/xampp"
<Directory "d:/_web/xampp">
    <IfModule php5_module>
       <Files "status.php">
          php_admin_flag safe_mode off
       </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>
</IfModule>


But I couldn't open "http://localhost:8080/xampp/".
hanpedro
 
Posts: 133
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby Sharley » 19. December 2011 06:21

Just try http://localhost:8080/xampp (no slash) or
http://locahost:8080/xampp/index.php

What does the error.log file say about why you can't open the xampp folder?

It worked for me perfectly when I replicated your exact configuration.

How about clearing your browser's cache and trying again.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby hanpedro » 19. December 2011 07:18

Sharley/

I tried to remove cashes and open but still could not be browsed.

This is the error log:

[Mon Dec 19 14:36:10 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 19 14:36:10 2011] [notice] Digest: done
[Mon Dec 19 14:36:10 2011] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Mon Dec 19 14:36:10 2011] [notice] Server built: Sep 10 2011 11:34:11
[Mon Dec 19 14:36:10 2011] [notice] Parent: Created child process 10720
[Mon Dec 19 14:36:11 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 19 14:36:11 2011] [notice] Digest: done
[Mon Dec 19 14:36:11 2011] [notice] Child 10720: Child process is running
[Mon Dec 19 14:36:11 2011] [notice] Child 10720: Acquired the start mutex.
[Mon Dec 19 14:36:11 2011] [notice] Child 10720: Starting 150 worker threads.
[Mon Dec 19 14:36:11 2011] [notice] Child 10720: Starting thread to listen on port 443.
[Mon Dec 19 14:36:11 2011] [notice] Child 10720: Starting thread to listen on port 443.
[Mon Dec 19 14:36:11 2011] [notice] Child 10720: Starting thread to listen on port 8080.
[Mon Dec 19 14:36:11 2011] [notice] Child 10720: Starting thread to listen on port 8080.
[Mon Dec 19 14:37:41 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Mon Dec 19 14:37:41 2011] [notice] Child 10720: Exit event signaled. Child process is ending.
[Mon Dec 19 14:37:42 2011] [notice] Child 10720: Released the start mutex
[Mon Dec 19 14:37:43 2011] [notice] Child 10720: All worker threads have exited.
[Mon Dec 19 14:37:43 2011] [notice] Child 10720: Child process is exiting
[Mon Dec 19 14:37:43 2011] [notice] Parent: Child process exited successfully.
[Mon Dec 19 14:37:52 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 19 14:37:52 2011] [notice] Digest: done
[Mon Dec 19 14:37:53 2011] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Mon Dec 19 14:37:53 2011] [notice] Server built: Sep 10 2011 11:34:11
[Mon Dec 19 14:37:53 2011] [notice] Parent: Created child process 10804
[Mon Dec 19 14:37:53 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 19 14:37:53 2011] [notice] Digest: done
[Mon Dec 19 14:37:54 2011] [notice] Child 10804: Child process is running
[Mon Dec 19 14:37:54 2011] [notice] Child 10804: Acquired the start mutex.
[Mon Dec 19 14:37:54 2011] [notice] Child 10804: Starting 150 worker threads.
[Mon Dec 19 14:37:54 2011] [notice] Child 10804: Starting thread to listen on port 443.
[Mon Dec 19 14:37:54 2011] [notice] Child 10804: Starting thread to listen on port 443.
[Mon Dec 19 14:37:54 2011] [notice] Child 10804: Starting thread to listen on port 8080.
[Mon Dec 19 14:37:54 2011] [notice] Child 10804: Starting thread to listen on port 8080.


Is it possible that the virtual host settings is related to this?

Thsi is my httpd-vhosts.conf.

Code: Select all
# lcalhost server
<VirtualHost *:8080>
ServerName dmtest.localhost
ServerAlias www.dmtest.localhost
ServerPath d:/_web/dmtest
DocumentRoot d:/_web/dmtest
 <Directory "d:/_web/dmtest">
     Options -Indexes FollowSymLinks
     AllowOverride None
     Order allow,deny
     Allow from all
 </Directory>
ErrorLog d:/apm_packages/xampp/Apache/logs/dmtest_localhost_error_.log
CustomLog d:/apm_packages/xampp/Apache/logs/dmtest_localhost_access.log combined
</VirtualHost>
hanpedro
 
Posts: 133
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby hanpedro » 06. January 2012 22:14

I've resolved this problem thanks to this guide "How to move your xampp localhost files to another location using an alias"
-http://bartv.hubpages.com/hub/How-to-move-xampp-localhost-files-to-another-location -.
hanpedro
 
Posts: 133
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Parse error: syntax error in \xampp\lang\en.php on line

Postby Altrea » 06. January 2012 22:21

Hi hanpedro,

Thanks for the feedback. Glad you got it working :D
Marked as solved.

best wishes,
Altrea
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: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: DrSeussFreak and 59 guests