I just developed my drupal website on my localhost. Everything was okay so i decided to move to live environment.
On my webhosting space i have one last problem.

Parse error: syntax error, unexpected T_FUNCTION in /sites/all/themes/grid_inspired/template.php on line 1

My template got a template.php file in the directory. When i remove this file, the error message is gone. but i don't get my display blocks installed, of course, they are defined in the template.php.

i did some test:

i removed all code from the template.php except the opening php tag: same error message
i removed all code from the template.php except the opening php tag and i closed the php tag: no error message

Any help will be appreciated.

my configuration:

Godaddy Linux Shared Hosting
PHP Version 5.2.5
MySql 5.0

Comments

masande’s picture

this error means that the php compiler has found a function where it should not be. it is generally is caused by not finishing a line with a semi-color, closing parenthesis in a function or closing a brace in defining or specifying an array. check the contents of your template.php to see if you find any of those problems. it's likely near the top since the file is erroring out on line 1.

if it is not too long, feel free to post the contents of your template.php so experienced eyes can pour over it to help solve the problem.

Mark Sanders
Q Collective

Mark Sanders
Q Collective

Anonymous’s picture

thanks, that helped me to find the solution. it turned out that my ftp program was killing the linebreaks or something wired. so the file was completely scrambled on the server.

don't know what setting made this happen, but if you are experiencing similar issues, i can only recommend you to try another way of uploading your files.