Eclipse/PHP: PDO cannot be resolved as a type - pdo

i like to convert a old PHP Project from PHP 5.1 to PHP 7.2. I changed in the project settings the PHP Version (Project/Properties/PHP/Validation) to 7.2. The Project was rebuild.
I added new PHP Code:
while ($row = $rs->fetch(PDO::FETCH_ASSOC)){
A red x at the side displays: "PDO cannot be resolved as a type"
How can i remove or IGNORE this kind of error?
Thanks!

Related

Uwamp - V 3.1 - Php 7.0.3 - Error [simple fix]

Just to let you know there seems to be an issue with the latest version, when selecting the php 7 option, it loads the httpd.conf rather the httd-uwamp.conf file, so cant find the php7xxxx.dll and will stop from apache from working / loading.
thanks
removing the double-quotes form the httpd_uwamp.conf file worked for me on both UnWamp and PHP distributions. (No spaces are in any of my path names)
i.e.
change
LoadModule "{PHPMODULENAME} {PHPPATH}/{PHPAPACHE2FILE}"
to
LoadModule {PHPMODULENAME} {PHPPATH}/{PHPAPACHE2FILE}
You should install redistributable Visual C++ 2015 x86 version on your system. Previous versions don't work well with php7. You can download it here.

SQL Error since upgrading to MAMP v 3.5

I have a script that I run to create a Wordpress website. All runs well until I get to the:
wp core install --title=$client --url=$client.local --admin_user=$clientshort-admin --admin_password=******** --admin_email=********#gmail.com
I get the following:
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Applications/MAMP/htdocs/pndesign2/web/wp/wp-includes/wp-db.php on line 1488
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Applications/MAMP/htdocs/pndesign2/web/wp/wp-includes/wp-db.php on line 1518
Warning: mysql_connect(): No such file or directory in /Applications/MAMP/htdocs/pndesign2/web/wp/wp-includes/wp-db.php on line 1518
Error: Error establishing a database connection
THanks!
After going round in circles, it was down to the PHP version differences between OSX/MAMP/ and WP-CLI.
Updating your .bash_profile with the version of MAMP solves it - more details here How to override the path of PHP to use the MAMP path?

How do I fix this error “execv() arg 2 must contain only strings” in OpenERP 7 webkit report?

We're using OpenERP 7.0 in Ubuntu Server 12.04 and we have installed following modules:
report_webkit
account_financial_report_webkit
account_financial_report_webkit_xls
When we press the "PRINT" button this error occurs:
execv() arg 2 must contain only strings
But when push button "EXPORT TO EXCEL" it runs ok.
We have installed wkhtmltopdf version 0.12.1.2
Could you help us?
We have this problem too. Is happening when the command used in subprocess.call, has a parameter with unicode encoded characters.
I've managed to solve it by changing system locale and restarting Odoo/OpenERP.
By default the locale is set as shown:
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
By changing it to an UTF8 compatible locale the error is not happening anymore.
LANG=es_ES.utf8
LANGUAGE=
LC_CTYPE="es_ES.utf8"
LC_NUMERIC="es_ES.utf8"
LC_TIME="es_ES.utf8"
LC_COLLATE="es_ES.utf8"
LC_MONETARY="es_ES.utf8"
LC_MESSAGES=es_ES.utf8
LC_PAPER="es_ES.utf8"
LC_NAME="es_ES.utf8"
LC_ADDRESS="es_ES.utf8"
LC_TELEPHONE="es_ES.utf8"
LC_MEASUREMENT="es_ES.utf8"
LC_IDENTIFICATION="es_ES.utf8"
LC_ALL=
The problem is already solved. You can check this fix on OCA Git Hub. You just should update the account_financial_report_webkit module with the new commits. The pull request was not made in the OpenERP 7 version, so maybe you should copy the code manually or wait for the pull-request.
Another solution (workaround) is to change the system variable LANG: LANG=en_US.UTF-8

Can't get PhantomJS to work with a simple example

I've downloaded the executable and created a simlink to /usr/local/bin.
I'm under Mac OSX 10.7
When I then try to run a script that requires some module i.e.
var page = require('webpage').create();
I got an error
undefined:0 ReferenceError: Can't find variable: require
as if 'require' is not seen as a reserved word but interpreted as a variable symbol.
(As an aside, whenever I lunch phantomjs a Sencha Touch icon appears in my Dock)
Your copy of PhantomJS is from an older version. Always get the latest one from http://phantomjs.org.
I had this issue too, and the problem was my version of mocha -- going back to 1.9.0 fixed it.
SenchaTouch 2.0 installs PhantomJS 1.1 somewhere depending on the OS. Under *NIX check where with 'which phantomjs'.
Just modify your bash or whatever configuration file accordingly to remove the Phantomjs included with SenshaTouch from your PATH.

Error loading javascript after installing Umbraco 4.7.1

I'm working on an umbraco 4.7.0 project and I have upgrated from 4.7.0 to 4.7.1
It's worked like a charm in my localhost but I have a problem after installing it on the staging server :
When I connect to the backend, I have the javascript error : "Jquery(xx).mask(...) : function does not exist" and any key press execute the umbraco Save function.
The jquery mask plugin is used in umbraco 4.7.1 to add a date mask to the publish date in the property tab.
The Jquery mask plugin is new in Umbraco 4.7.1 and is being included by "DateTimePicker.cs" with [ClientDependency(ClientDependencyType.Javascript, "MaskedInput/jquery.maskedinput-1.3.min.js", "UmbracoClient")]
See : https://hg01.codeplex.com/umbraco/rev/d2304aa897d4
However, even if I delete on the Staging server the bin,umbraco and umbraco-client folders and replace them with the ones from my local computer (where it works) the bug is still here.
But if I change
< compilation defaultLanguage="c#" debug="false" batch="false" targetFramework="4.0">
to
< compilation defaultLanguage="c#" debug="true" batch="false"targetFramework="4.0">
in the web.config THEN it works...
Does someone understand what happened ? How can I make it works with compilation debug=true ??
Thank you very much
Fabrice
As nobody answered this question, I asked on the umbraco forum here :
http://our.umbraco.org/forum/getting-started/installing-umbraco/25196-Error-loading-javascript-after-installing-Umbraco-471
The answer is :
"it's the outdated client dependency cache to blame (when you set debug="true" in your web.config this cache is turned off by design). Try simply to clean the contents of the client dependency cache folder (by default it's App_Data/TEMP/ClientDependency)."