简体   繁体   English

如何在Amazon Linux x64实例上安装IonCube Loader

[英]How to install IonCube Loader on Amazon Linux x64 instance

I'm having trouble installing IonCube Loader on my Amazon Linux x64 instance. 我在Amazon Linux x64实例上安装IonCube Loader时遇到问题。

I'm following these instructions below but the paths are way off and I can't seem to locate the right ones on my install. 我按照下面的说明进行操作,但是路径偏远,在安装时似乎找不到正确的路径。

For x64: 对于x64:

wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz 
tar xfvz ioncube_loaders_lin_x86-64.tar.gz

Proceed as follows: 进行如下:

cp ioncube/ioncube_loader_lin_5.3.so /usr/lib/php5/20090626/ioncube.so

Now edit to match: 现在编辑以匹配:

zend_extension = /usr/lib/php5/20090626/ioncube.so

nano /etc/php5/conf.d/ioncube.ini

First, there is no /usr/lib/php5/20090626/ folder. 首先,没有/usr/lib/php5/20090626/文件夹。 I changed these paths to /usr/lib64/php/modules and included the .so file in there. 我将这些路径更改为/usr/lib64/php/modules并在其中包含.so文件。

However, I cannot seem to locate any ioncube.ini file to edit. 但是,我似乎找不到任何要编辑的ioncube.ini文件。 Any help is appreciated... 任何帮助表示赞赏...

Thank you! 谢谢!

For future readers sake, there is a difference between Amazon's Linux and other versions that most articles online refer to. 为了将来的读者起见,Amazon的Linux与大多数在线文章所引用的其他版本之间存在差异。

You can follow the first two steps above to get the installer, I like to use a temporary folder. 您可以按照上面的前两个步骤来获取安装程序,我喜欢使用一个临时文件夹。 Do this as root: 以root身份执行此操作:

sudo -i
cd /tmp
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz 
tar xfvz ioncube_loaders_lin_x86-64.tar.gz

Copy the required extension to a slightly different folder under EC2 linux instances, and the loader wizard to your webroot: 将所需的扩展名复制到EC2 linux实例下稍有不同的文件夹中,然后将加载程序向导复制到您的webroot中:

cp ioncube/ioncube_loader_lin_5.4.so /usr/lib64/php/modules/ioncube.so

Create your ini file: 创建您的ini文件:

echo "zend_extension=/usr/lib64/php/modules/ioncube.so" > /etc/php.d/ioncube.ini

Reload Apache (if you're using it): 重新加载Apache(如果正在使用):

service httpd restart

I'm using NGINX and PHP-FPM, in this case you'd probably want to restart PHP-FPM as well as NGINX. 我正在使用NGINX和PHP-FPM,在这种情况下,您可能希望重新启动PHP-FPM和NGINX。

Lastly, use the loader wizard to test it by navigating to http://example.com/loader-wizard.php , and delete the temp files and loader wizard when finished: 最后,使用加载器向导通过导航到http://example.com/loader-wizard.php对其进行测试,并在完成后删除临时文件和加载器向导:

rm -rf /tmp/ioncube*
rm /var/www/html/loader-wizard.php

I followed the instructions provided here in the first answer, making allowance for the fact that I'm runnning PHP 5.6: 我按照第一个答案中的说明进行操作,考虑到我正在运行PHP 5.6:

sudo cp ioncube_loader_lin_5.6.so /usr/lib64/php/5.6/modules/ioncube.so
echo "zend_extension=/usr/lib64/php/5.6/modules/ioncube.so" > /etc/php.d/ioncube.ini

However, when restarting Apache, I found that it started then failed immediately. 但是,重新启动Apache时,我发现它先启动然后立即失败。 The Apache log gave me this error: Apache日志给了我这个错误:

PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0

I changed the name of the file from ioncube.so to 00-ioncube.so and restarted Apache. 我将文件名从ioncube.so更改00-ioncube.so并重新启动了Apache。 This solved the problem by making this file load before the other modules. 通过使此文件在其他模块之前加载,解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM