We're connecting to an old AS400 database through an iSeries linux driver. Everything works fine: we can connect and query the base with no problems, but we'd like to correct this error, as it fills the log file every time the script is run:
PHP: syntax error, unexpected '(' in /etc/php.d/odbc.ini on line 14
The ini file is included in the script using:
putenv('ODBCSYSINI=/etc');
putenv('ODBCINI=/etc/odbc.ini');
This is the line 14 of the odbc.ini:
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
Any help will be greatly appreciated.
Related
Recently I met a weird error and hope someone can help.
We use LiteSpeed WebServer and Nginx on top, with PHP 7.5 and MySQL 5 (well, WordPress is the framework). It runs well for many days.
Suddenly it goes fatal at this line in different files
include ("class-xxx.php");
The error log says
[02-Oct-2018 13:04:36 UTC] PHP Fatal error: require(): Failed opening required 'dlass-xxx.php' (include_path='.:/opt/cpanel/ea-php72/root/usr/share/pear') in /xxx.php on line N
I double checked the code and see that the file name is declared "class-xxx.php", but somehow the server tries to include "dlass-xxx.php", thus it cannot find the file and trigger fatal error.
Solution? I re-upload the file, it works. But then it goes fatal in another file, at similar lines using include.
I notice that the first character in the file name, for example "c", is read incorrectly and shift 1 byte before (or after), so the file name is correct.
Such as
include "class-xxx.php" is parsed/read as "dclass-xxx.php"
include "page-xxx.php" is parsed"read as "opage-xxx.php"
...
this is very strange. Do anybody know the reason? Is it related to any caching/memory management of LiteSpeed or Nginx or PHP 7. ?
It happens on PHP 7. only because if I switch to PHP 5.6, the error does not happen.
Hope someone can help. Thanks a lot.
Yesterday my Apache installation stopped working with PHP applications like Wordpress, phpMyAdmin and Squirrelmail.
The problem is that Apache-php chokes on lines containing the "global" statement.
The Wordpress error looks like this:
PHP Parse error: syntax error, unexpected '$error' (T_VARIABLE) in /var/www/html/XXXXXXX/wordpress/wp-login.php on line 34
Line 34 contains the "global" statement:
global $error, $interim_login, $action;
Similar in phpMyAdmin:
PHP Parse error: syntax error, unexpected '$text_domains' (T_VARIABLE) in /usr/share/php/gettext/gettext.inc on line 47
Line 47 also includes the global statement:
global $text_domains, $default_domain, $LC_CATEGORIES, $EMULATEGETTEXT, $CURRENTLOCALE;
If I comment out the line PHP just fails on the next line including the "globa"l statement.
I tried to execute the file using php command line and it finishes without any error.
The latest software upgrades doesn't seem to be related.
iwl100-firmware
iwl1000-firmware
iwl105-firmware
iwl135-firmware
iwl2000-firmware
iwl2030-firmware
iwl3160-firmware
iwl3945-firmware
iwl4965-firmware
iwl5000-firmware
iwl5150-firmware
iwl6000-firmware
iwl6000g2a-firmware
iwl6000g2b-firmware
iwl6050-firmware
iwl7260-firmware
libappstream-glib
libertas-usb8388-firmware
linux-firmware
opus
rpcbind
tzdata
tzdata-java
webkitgtk4
webkitgtk4-jsc
webkitgtk4-plugin-process-gtk2
Hoping that someone has a clue.
Thanks
John
I start apache and mysql today as always do...but when I try to enter to phpmyadmin I'm getting this error:
Fatal error: require_once(): Failed opening required './libraries/php-gettext/gettext.inc' (include_path='C:\xampp\php\PEAR') in C:\xampp\phpMyAdmin\libraries\select_lang.lib.php on line 477
I don't understand what's happening =( ...I did nothing on the folders or config setup PLS HELP !!!
Simply go to C:\xampp\phpMyAdmin\libraries\ and cut that file select_lang.lib.php ,make sure you paste that item somewhere (if necessary), and phpadmin will run.
I have various PHP files, none of which have been modified prior to the app working and it breaking. My problem is that for some reason, these files are suddenly throwing PHP parse errors for things like 'unexpected' square brackets in seemingly random places throughout the file, but upon manually checking the file, the syntax is correct.
The only thing I did that could have 'altered' the files would be various chmod operations to change the permissions. But how/why would this change the actual content of the files?
The files are called on boot just as they always have been, and have worked fine in the past, up until the recent chmod changes.
Is this permanent, or will I just have to restore my system from an earlier time?
RHEL 6.5, PHP 5.4.
Edit:
Example of the error:
PHP Parse error: syntax error, unexpected '[' in /var/ptc/CRM-dev/tools/init on line 122
What's on line 122:
$files = [];
Another example:
PHP Parse error: syntax error, unexpected '[', expecting ')' in /var/ptc/CRM-dev/vendor/react/promise/src/functions.php on line 68
What's on line 68:
return resolve([]);
But these files themselves haven't been changed (as far as I'm aware), and the syntax looks correct.
phpinfo() gives 5.4.39, which is the same as when running php -v on the server.
If the PHP version has been changed then it may be stumbling on the PHP 5.4 square bracket array syntax.
Use phpinfo(); to be sure that the PHP version running the web server is the same as the one you're using on the CLI.
I created a PHP app on Heroku and I'm trying to connect to a Postgres database I set up on Heroku.
I put a snippet like this into the project:
$dbconn = pg_connect("host=thehost.amazon.whatever port=1010 dbname=blahblah user=jooghaha password=foofoo sslmode=require options='--client_encoding=UTF8'") or die('Could not connect: ' . pg_last_error());
However, when I try to request the file in the app, the server returns a generic HTTP 500 Error, and the Heroku logfiles say
PHP Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /app/www/pages/database.php on line 23
Any ideas?
The one line you posted looks fine. Assuming that line is really line 23 of /app/www/pages/database.php, you should look at the surrounding few lines to find the parse error. Often, PHP is not so precise at telling you where a syntax error is. Look in particular for unbalanced parentheses, missing semicolons, etc. in the lines above that snippet.