Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined function beast_encode_file() #51

Open
ejngnng opened this issue Mar 9, 2017 · 6 comments
Open

undefined function beast_encode_file() #51

ejngnng opened this issue Mar 9, 2017 · 6 comments

Comments

@ejngnng
Copy link

ejngnng commented Mar 9, 2017

`
~/Project/php-beast-master/tools$ sudo php encode_files.php
PHP Notice: Use of undefined constant BEAST_ENCRYPT_TYPE_DES - assumed 'BEAST_ENCRYPT_TYPE_DES' in /home/ninja/Project/php-beast-master/tools/encode_files.php on line 127
Source code path: /var/www/www/web_werouter/app
Destination code path: /home/ninja/Project/
Expire time: 2017-03-09 10:40:00
------------- start process -------------
PHP Fatal error: Uncaught Error: Call to undefined function beast_encode_file() in /home/ninja/Project/php-beast-master/tools/encode_files.php:76
Stack trace:
#0 /home/ninja/Project/php-beast-master/tools/encode_files.php(69): encrypt_directory('/var/www/www/we...', '/home/ninja/Pro...', 1489027200, 'BEAST_ENCRYPT_T...')
#1 /home/ninja/Project/php-beast-master/tools/encode_files.php(69): encrypt_directory('/var/www/www/we...', '/home/ninja/Pro...', 1489027200, 'BEAST_ENCRYPT_T...')
#2 /home/ninja/Project/php-beast-master/tools/encode_files.php(153): encrypt_directory('/var/www/www/we...', '/home/ninja/Pro...', 1489027200, 'BEAST_ENCRYPT_T...')
#3 {main}
thrown in /home/ninja/Project/php-beast-master/tools/encode_files.php on line 76

`
我的环境是虚拟机运行的ubuntu16.10 64bit, php7.0, 加密的时候提示找不到这个函数,可是编译都正常啊

@liexusong
Copy link
Owner

你可以在配置文件没有加入扩展,或者载入的配置文件路径错了

@ejngnng
Copy link
Author

ejngnng commented Mar 10, 2017

Thanks!

我在 /etc/php/7.0/apache2/php.ini 中已经添加的了extension=beast.so,

/home/ninja/Project/php-beast-master/tools/configure.ini
; source path
src_path = "/var/www/www/web_werouter/app"

; destination path
dst_path = "/home/ninja/Project/"

; expire time
expire = "2017-03-09 10:40:00"

; encrypt type
encrypt_type = "DES"

@liexusong 这个 soure path 和 dst path 是要指定某个文件 还是某个目录?

@liexusong
Copy link
Owner

目录

@ai400
Copy link

ai400 commented Jul 5, 2017

我也是同样的问题:
环境:
CentOS Linux release 7.3.1611
nginx version: nginx/1.12.0
PHP 5.6.30 (cli) (built: May 31 2017 09:43:17)
模块已载入:
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=beast.so

[root@www tools]# php encode_files.php
Source code path: /data/www
Destination code path: /data/beast
Expire time: 2099-12-31
------------- start process -------------
Fatal error: Call to undefined function beast_encode_file() in /data/php-beast-master/tools/encode_files.php on line 78

@shanggun
Copy link

shanggun commented Dec 13, 2017

您好,我也出现了这种问题,编译是没有报错,使用info.php,可以看到扩展已经安装了的信息。
环境:ubutun 14.04,apache2.4 php.5.6
按照readme中的步骤走,是否还有什么特殊的地方需要注意的,需要添加哪些库文件?gcc的版本最好使用哪个?@liexusong,@ejngnng谢谢

@shanggun
Copy link

使用php -c your_conifg_path/php.ini encode_files.php 可以解决这个问题.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants