Php Syntax Error Near Unexpected Token
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us syntax error near unexpected token (' bash Learn more about Stack Overflow the company Business Learn more about hiring developers
Syntax Error Near Unexpected Token In Shell Script
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack syntax error near unexpected token r in shell script Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Cron syntax error near unexpected token up
Syntax Error Near Unexpected Token In Unix
vote 3 down vote favorite Moved the site to another server. Add file statistic.php to the Сron to perform. Only this Cron that does not like something. Write errors: /home/site/www/statistic.php: line 1: ?php: No such file or directory /home/site/www/statistic.php: line 2: syntax error near unexpected token `"bd.php"' /home/site/www/statistic.php: line 2: `include ("bd.php"); There is my code
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or
Syntax Error Near Unexpected Token Perl
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Bash Function Syntax Error Near Unexpected Token
Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only syntax error near unexpected token python takes a minute: Sign up syntax error near unexpected token ' - bash up vote 8 down vote favorite 1 I have a written a sample script on my Mac #!/bin/bash test() { echo "Example" } test exit 0 and this http://stackoverflow.com/questions/28442666/cron-syntax-error-near-unexpected-token works fine by displaying Example When I run this script on a RedHat machine, it says syntax error near unexpected token ' I checked that bash is available using cat /etc/shells which bash shows /bin/bash Did anyone come across the same issue ? Thanks in advance ! linux bash shell scripting share|improve this question edited Dec 7 '15 at 20:12 Tomasz Jakub Rup 5,06471436 asked Jan 3 '14 at 3:20 user3155779 43113 still the same . . –user3155779 Jan http://stackoverflow.com/questions/20895946/syntax-error-near-unexpected-token-bash 3 '14 at 3:23 hmm I don't know. I can execute this correctly on a Fedora machine. –Michael Berkowski Jan 3 '14 at 3:25 1 Can you recreate the entire file? Perhaps you have a non-printable in there causing the fault. –Michael Berkowski Jan 3 '14 at 3:28 4 @user3155779 Could you close the question, since the actual problem didn't relate to anything asked here (that is, wasn't found in the code as-given byte-for-byte)? –Charles Duffy Jan 3 '14 at 4:47 3 This question appears to be off-topic because the solution was unrelated to the question as asked. –chepner Jan 3 '14 at 16:23 | show 4 more comments 4 Answers 4 active oldest votes up vote 19 down vote accepted It could be a file encoding issue. I have encountered file type encoding issues when working on files between different operating systems and editors - in my case particularly between Linux and Windows systems. I suggest checking your file's encoding to make sure it is suitable for the target linux environment. I guess an encoding issue is less likely given you are using a MAC than if you had used a Windows text editor, however I think file encoding is still worth considering. --- EDIT (Add an actual solution as recommended by @Potatoswatter) To demonstrate how file type encoding could be this issue, I copy/pasted your example script into Notepad in Windows (I don't
From: mansion@php.net Assigned: ohill Status: Closed Package: geoip (PECL) PHP Version: 5.4.28 OS: centos 6 Private report: No CVE-ID: https://bugs.php.net/bug.php?id=67178 View Add Comment Developer Edit [2014-05-02 07:30 UTC] mansion@php.net Description: ------------ I get the following error when trying to configure version 1.1.0 checking for geoip support... yes, shared ./configure: line 5329: syntax error near unexpected token `fi' ./configure: line 5329: `fi' Test script: --------------- pecl install -f http://pecl.php.net/get/geoip-1.1.0.tgz Expected result: ---------------- Configure script syntax error should pass. Actual result: -------------- Configure script has errors. Patches Add a PatchPull Requests Add a Pull RequestHistoryAllCommentsChangesGit/SVN commitsRelated reports [2014-05-03 17:48 UTC] ohill@php.net -Status: Open +Status: Closed -Assigned To: +Assigned To: ohill [2014-05-03 17:48 UTC] ohill@php.net This issue is fixed on SVN (Thanks to remi) Will issue a 1.1.1 soon, in syntax error near the meantime please try a version from SVN and let me know if it works. [2015-04-06 10:33 UTC] nickg78 at gmail dot com How long do you mean "soon"? 1 year later after your last commend, and the faulty 1.1.0 version is still the latest available online... [2016-03-31 10:07 UTC] balugeorge at gmail dot com Since a newer version with the fix haven't yet been released, details of building the package from SVN are as follows: ----------------- svn checkout http://svn.php.net/repository/pecl/geoip/trunk/ geoip cd geoip phpize ./configure make make install ----------------- After installation, add "extension=geoip.so"(without quotes) to the php.ini file(or to the custom geip.ini file) and restart apache. Details regarding the geoip version can be found from the phpinfo file(similar to the below one) ================ geoip support => enabled geoip extension version => 1.1.1-dev geoip library version => 1005000 ================ Copyright © 2001-2016 The PHP Group All rights reserved. Last updated: Mon Oct 24 04:01:40 2016 UTC