Jump to content

Archived

This topic is now archived and is closed to further replies.

Manipe

Having trouble with forcetype

Recommended Posts

I'm having major trouble with a PHP script which is accessed through a forcetype definition in a .htaccess file in the same folder.
When I run the file through the forcetype file path, it gives me the following error:

Parse error: parse error, unexpected $ in 'file' on line 246

But then when i change the contents of the file to a normal PHP file, it works fine and as expected, with no errors at all.
I have isolated the problem code, and have tried putting it in a function to bypass the error, but it still doesn't work.
Because it works as a PHP file, I believe that the problem lies in the apache side of things.

Can anyone help, or has anyone had a similar problem before.

All help is greatly appreciated.  ;)

Share this post


Link to post
Share on other sites
[quote author=Manipe link=topic=104203.msg415425#msg415425 date=1155562630]
I'm having major trouble with a PHP script which is accessed through a forcetype definition in a .htaccess file in the same folder.
When I run the file through the forcetype file path, it gives me the following error:

Parse error: parse error, unexpected $ in 'file' on line 246

But then when i change the contents of the file to a normal PHP file, it works fine and as expected, with no errors at all.
I have isolated the problem code, and have tried putting it in a function to bypass the error, but it still doesn't work.
Because it works as a PHP file, I believe that the problem lies in the apache side of things.

Can anyone help, or has anyone had a similar problem before.

All help is greatly appreciated.  ;)
[/quote]

Have you tried this? AddType application/x-httpd-php .myextension
'myextension' being whatever extension you are using

If that doesn't work, then it's a problem with your host (a problem I've had in the past). I believe it has something to do with the host not allowing you to override the extensions, or it could be a PHP safe mode protocol. If all comes to worse, you should switch your host.

Share this post


Link to post
Share on other sites
Thanks to you all, I've fixed it now. I re-uploaded everything and it just worked. Don't know how, but all I know now is that it's working fine. cheers for the help.

Share this post


Link to post
Share on other sites
[quote author=Manipe link=topic=104203.msg429137#msg429137 date=1157545381]
Thanks to you all, I've fixed it now. I re-uploaded everything and it just worked. Don't know how, but all I know now is that it's working fine. cheers for the help.
[/quote]

Excellent. Let us know if you have any more problems. :)

Share this post


Link to post
Share on other sites
[quote author=Manipe link=topic=104203.msg429137#msg429137 date=1157545381]
Thanks to you all, I've fixed it now. I re-uploaded everything and it just worked. Don't know how, but all I know now is that it's working fine. cheers for the help.
[/quote]

Ok thanks for letting us know if you need any other help just ask mate.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.