syntax error, unexpected T_STRING PHPMAILER line 22 - syntax-error

Parse error: syntax error, unexpected T_STRING in /home1/mast1456/public_html/src/PHPMailer.php on line 22
line 22 namespace PHPMailer\PHPMailer;

This means you're running a very old version of PHP that doesn't understand namespaces, which were introduced in PHP 5.3. You need to run at least PHP 5.5 for PHPMailer anyway, but I would recommend you use PHP 7.4 for anything you're developing now.

Related

ioncube_loader Issue: undefined symbol: zend_execute_ex

I have been struggling with the above problem for days. I need the ioncube_loader for my Shopware (version 5.3.2 with PHP version 7.1.8). The server on which Shopware runs has PHP version 5.6.40!
Inside the shop I am told that I am using the ionCube Loader but when I log in to the server via SSH the error occurs.
The following outputs are available for the following commands in the console:
PHP Version
[root#vh1 ~]# php -v
Failed loading /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: undefined symbol: zend_execute_ex
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
extension_dir
[root#vh1 ~]# php -i | grep extension_dir
Failed loading /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: undefined symbol: zend_execute_ex
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
sqlite3.extension_dir => no value => no value
set include
; Enable ioncube extension module
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.1.so
Can someone tell me what I did wrong? I can not find anything about the bug about Google.
undefined symbol: zend_execute_ex
Why zend_execute_ex? Where does it come from? Can the error occur due to the permissions?
[root#vh1 ~]# ll /usr/lib64/php/modules/
total 8940
-rwxr-xr-x 1 root root 1500368 16. Jul 11:11 ioncube_loader_lin_5.6.so
-rwxr-xr-x 1 root root 1366576 11. Jun 15:33 ioncube_loader_lin_7.1.so
EDIT:
As soon as I open the plugin manager in the backend of Shopware I get the following error:
The file /path/to/shop/engine/Shopware/Plugins/Community/Frontend/CoeVoucherUrl
/Bootstrap.php was encoded by the ionCube Encoder
for PHP 5.6 and cannot run under PHP 7.1 or later.
Please ask the of the script to provide a version
encoded with the ionCube Encoder for PHP 7.1.
File:Unknown
The ioncube-version you are using is for php 7.1 and not for php 5.6. When using PHP 5.6 you need the ioncube_loader_lin_5.6.so. It's provided with the current loader-packages as well. You need to make sure the loader version is compatible with your php-version. The error message already states, that you are using the encoder for php 7.1.
On most servers php versions are different between CLI and Web, so you need to make sure the CLI is using the same version as the webserver and the ioncube version is compatible with it. Sometimes there are possibilities to call different php versions via cli by adding the version number (like php7.1 ...).
On to of that, you can't use any plugin from the shopware store that is encrypted with php 7.1+, since the encryption of the store only supports 5.6 and 7.0. If you want to use php 7.1, you need to make sure there are no encrypted plugins in your system. In this case the plugin manager will work again.
https://docs.shopware.com/en/shopware-5-en/update-guides/update-guide-shopware-55#but-i-still-have-encrypted-plugins

bWAPP- SQL injection Hack displays a white screen?

I've been following this video(https://www.youtube.com/watch?v=XDCZ8FC856s) to install bWAPP on Parrot OS and everything works fine except SQL Injection. I've checked the database and its active. As you can see:
And when I select SQL Injection(GET/Search) it just displays a blank white screen.
I've checked for answers in a couple of places but haven't found a robust answer. Any help would be awesome thanks.
Browser: Firefox Quantum 60.0.1(64-bit)
OS: Parrot( I also tried the same on Kali)
PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect()
It looks like your code uses the mysql extension, and that extension is not present.
In other words, the error has nothing to do with SQL injection. The code for this app can't run given the PHP installation you have installed.
Run the command php --version, you'll see something like this:
$ php --version
PHP 7.1.16 (cli) (built: Mar 31 2018 02:59:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
You probably you have PHP 7.0 or later, in which the mysql extension is no longer available. If that's the version of PHP you have, then you will have to change the code of your application, so that it uses either mysqli or PDO.
See these answers from 2016:
PHP : Undefined function mysql_connect()
Fatal error: Uncaught Error: Call to undefined function mysql_connect()
Editing code from the outdates mysql extension to the mysqli extension is pretty easy.
https://www.phpclasses.org/blog/package/9199/post/3-Smoothly-Migrate-your-PHP-Code-using-the-Old-MySQL-extension-to-MySQLi.html
https://dzone.com/articles/convert-mysql-to-mysqli
There are many videos on YouTube about updating mysql code to mysqli. I haven't watched any of them so I can't recommend any specific video.
The other possibility is that you have PHP 5.6, but the installation is incomplete. You may be able to install an optional package to add the mysql extension to a PHP 5 installation. See this answer:
Fatal error: Call to undefined function mysql_connect()

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?

cURL not run in xampp v5.6.3

I try to run cURL in xampp v5.6.3 (PHP 5.6.3) last version,
In xampp/php/php.ini
extension=php_curl.dll is without ;
other php.ini i can't found in this new version of xampp,
when i try test from this http://www.mattsbits.co.uk/item-164.html
I get error:
Parse error: syntax error, unexpected 'color' (T_STRING), expecting ',' or ';' in C:\xampp\htdocs\test\check_curl.php on line 16
cURL isn't returning anything, anyone know solution ?
Thanks.
I might be a bit late with answer but i had the same issue. I recommend downgrading a bit. My old php version was 5.5.15, curl seems to work there just fine.

How to deploy fuelphp website to server

I'm new to fuelPHP, I developed a simple application and when I uploaded the files to my web server I got those errors :
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /home1/tdfdf/public_html/site/site/public/index.php on line 22
Fatal error: require() [function.require]: Failed opening required '/bootstrap.php' (include_path='.:/usr/lib64/php:/usr/lib/php:/usr/share/pear') in /home1/tdfdf/public_html/site/site/public/index.php on line 44
I probably miss some configurations here. I also want to remove this "/public" from the url
Can any one help ?
I found the solution. The DIR is not defined for older versions of PHP . I changed my server settings to run on PHP 5.3 and it worked like magic.
Thanks.