PHP - 获取文件/文件夹相对路径

With JavaScript, if you have the input tag set up like this...

<input type="file" multiple webkitdirectory directory />

You able to get the relative path of a selected file by doing this...

document.getElementsByTagName('INPUT')[0].files[0].webkitRelativePath

My question is how do you get the relative path of a file from a input tag just like this with PHP? With PHP your able to get a file name, type, size but how do you get its relative path?

2个回答

Relative path to a file stored on your computer is not available for PHP as it's Server Side. So once you submit your form your file is included into the request and the source path is not available anymore.

But you could potentially use different techniques (a combination of JavaScript making async request to the server - AJAX, or another field, could be hidden, storing the file path info) to pass the path information to the server.

展开翻译

译文



计算机上存储的文件的相对路径不适用于PHP,因为它是服务器端。 因此,一旦您提交表单,您的文件就会包含在请求中,并且源路径将不再可用。 </ p>

但是您可能会使用不同的技术(将JavaScript与服务器异步请求组合在一起 - AJAX或其他字段,可以隐藏,存储文件路径信息)以传递路径 信息到服务器。 </ p>
</ div>

Relative directories don't work the way you think they should in PHP (according to your JavaScript way of thinking) -- Mainly because PHP is server side and theoreticaly can access any file within the operating system (unless jailed etc) -- The closest you're going to find is something like $_SERVER['DOCUMENT_ROOT'] which will give you the relative path to the web root -- However if you are running PHP client based -- There is no "relative root" -- In cli, you simply use ./ (or nothing), ../, / to tell php "related to the same directory as the script" IE

./directory/yourfile.txt   //This starts in the SAME directory as the php file

../directory/yourfile.txt  // This goes up one directory, and then you can drill back down.

../../../directory/directory/directory/file.txt  // Just like above, but up 3 directories

/directory.file.txt // Starts from the server root -- IE /var/www/etc/etc/etc

Other than using these methods you can write your own way of handling this with your own methods etc -- There are many schools of though on this as well. Some say using absolute paths is the way to go ... But others argue that for portability relative is the way. Really it depends on your program and what you're using it for .. Whether it's getting deployed etc .. If it's the latter, and it's web-based, $_SERVER['DOCUMENT_ROOT'] will suffice, but you should structure your program to make classes, controllers, modules etc etc easily accessible when coding. (hence write methods to handle directory locations)


UPDATE per your comment

You asked if it was possible to pass this to php, and the answer is - yes, and no.

Yes, if the page has already loaded and you want to send the info as part of an action (form submit / AJAX call)

Yes, if you already have loaded the page, and have stored a cookie with this information on a previous page / session

No if a user has never been to the page and first pageload has already happened, and no other actions are expected to happen such as AJAX or form submissions.

Based on what you're asking you should be able to simply:

var mypath = document.getElementsByTagName('INPUT')[0].files[0].webkitRelativePath

 $.post("send_path_to_php.php", {path: mypath}, function(result){
     alert(result);  // result of php page response
 });

This will send the var mypath to a php file called send_path_to_php.php. The php file will be able to extract $_POST['path] Then you do whatever you want in said php -- Whatever you echo/return will be in the callback of result

dongxkbjiaofea1163
dongxkbjiaofea1163 请参阅上面的更新
一年多之前 回复
douzhi8244
douzhi8244 使用客户端计算机的输入标记无法获取文件的相对路径?
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
linux下php添加mysqli拓展库时,编译报错

php和mysql都是已经编译安装好了,现在想要给php添加mysqli 拓展库,结果在make的时候报错 ``` cd /usr/local/src/php-5.6.19/ext/mysqli /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config make ``` 报错信息如下: ``` [root@zhoujun mysqli]# make /bin/sh /usr/local/src/php-5.6.19/ext/mysqli/libtool --mode=compile cc -I. -I/usr/local/src/php-5.6.19/ext/mysqli -DPHP_ATOM_INC -I/usr/local/src/php-5.6.19/ext/mysqli/include -I/usr/local/src/php-5.6.19/ext/mysqli/main -I/usr/local/src/php-5.6.19/ext/mysqli -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/mysql/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c -o mysqli_api.lo cc -I. -I/usr/local/src/php-5.6.19/ext/mysqli -DPHP_ATOM_INC -I/usr/local/src/php-5.6.19/ext/mysqli/include -I/usr/local/src/php-5.6.19/ext/mysqli/main -I/usr/local/src/php-5.6.19/ext/mysqli -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/mysql/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c -fPIC -DPIC -o .libs/mysqli_api.o 在包含自 /usr/local/mysql/include/my_global.h:68 的文件中, 从 /usr/local/src/php-5.6.19/ext/mysqli/php_mysqli_structs.h:63, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:34: /usr/local/mysql/include/my_config.h:649:1: 警告:“PACKAGE_NAME”重定义 在包含自 /usr/local/php/include/php/TSRM/tsrm_config.h:1 的文件中, 从 /usr/local/php/include/php/TSRM/tsrm_config_common.h:13, 从 /usr/local/php/include/php/Zend/zend_virtual_cwd.h:27, 从 /usr/local/php/include/php/main/php.h:404, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:29: /usr/local/php/include/php/main/../main/php_config.h:2192:1: 警告:这是先前定义的位置 在包含自 /usr/local/mysql/include/my_global.h:68 的文件中, 从 /usr/local/src/php-5.6.19/ext/mysqli/php_mysqli_structs.h:63, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:34: /usr/local/mysql/include/my_config.h:650:1: 警告:“PACKAGE_STRING”重定义 在包含自 /usr/local/php/include/php/TSRM/tsrm_config.h:1 的文件中, 从 /usr/local/php/include/php/TSRM/tsrm_config_common.h:13, 从 /usr/local/php/include/php/Zend/zend_virtual_cwd.h:27, 从 /usr/local/php/include/php/main/php.h:404, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:29: /usr/local/php/include/php/main/../main/php_config.h:2195:1: 警告:这是先前定义的位置 在包含自 /usr/local/mysql/include/my_global.h:68 的文件中, 从 /usr/local/src/php-5.6.19/ext/mysqli/php_mysqli_structs.h:63, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:34: /usr/local/mysql/include/my_config.h:651:1: 警告:“PACKAGE_TARNAME”重定义 在包含自 /usr/local/php/include/php/TSRM/tsrm_config.h:1 的文件中, 从 /usr/local/php/include/php/TSRM/tsrm_config_common.h:13, 从 /usr/local/php/include/php/Zend/zend_virtual_cwd.h:27, 从 /usr/local/php/include/php/main/php.h:404, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:29: /usr/local/php/include/php/main/../main/php_config.h:2198:1: 警告:这是先前定义的位置 在包含自 /usr/local/mysql/include/my_global.h:68 的文件中, 从 /usr/local/src/php-5.6.19/ext/mysqli/php_mysqli_structs.h:63, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:34: /usr/local/mysql/include/my_config.h:652:1: 警告:“PACKAGE_VERSION”重定义 在包含自 /usr/local/php/include/php/TSRM/tsrm_config.h:1 的文件中, 从 /usr/local/php/include/php/TSRM/tsrm_config_common.h:13, 从 /usr/local/php/include/php/Zend/zend_virtual_cwd.h:27, 从 /usr/local/php/include/php/main/php.h:404, 从 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:29: /usr/local/php/include/php/main/../main/php_config.h:2204:1: 警告:这是先前定义的位置 /usr/local/src/php-5.6.19/ext/mysqli/mysqli_api.c:36:47: 错误:ext/mysqlnd/mysql_float_to_double.h:没有那个文件或目录 make: *** [mysqli_api.lo] 错误 1 ``` 求大虾帮忙!!。

php交叉编译 make无法产生php-cgi 文件

php交叉编译 make无法产生php-cgi 文件, 配置 ./configure --target=bfin-linux-uclibc --with-libxml-dir=/opt/uClinux/bfin-uclinux/ --with-zlib-dir=/opt/uClinux/bfin-uclinux/ --prefix=/opt/uClinux/bfin-uclinux/php/ --disable-all --with-config-file-path=/opt/uClinux/bfin-uclinux/php/ --with-config-file-scan-dir=/opt/uClinux/bfin-uclinux/php/ --enable-discard-path --disable-cli --enable-cgi --without-iconv --enable-force-cgi-redirect make 时也不提示错误, 但是spai/cgi 目录中没有php-cgi文件 make install 过不去

linux中安装php扩展报扩展包错误

路径和php.ini里面都加了,然后一重启php-fpm就报错 具体错误如下: Starting php-fpm [08-Oct-2018 11:43:56] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so' (tried: /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so: undefined symbol: zval_used_for_init), /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 <br /> <b>Warning</b>: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so' (tried: /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so: undefined symbol: zval_used_for_init), /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/redis.so.so: cannot open shared object file: No such file or directory)) in <b>Unknown</b> on line <b>0</b><br />

-bash: /usr/bin/xdpyinfo: 没有那个文件或目录

-bash: /usr/bin/xdpyinfo: 没有那个文件或目录 请问这个要怎么解决啊?

求救:kali数据库启动后依然无法打开metasploit

在终端输入 msfconsole后出现: A database appears to be already configured, skipping initialization /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- msf/core/payload/firefox (LoadError) from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core/payload.rb:32:in `<class:Payload>' from /usr/share/metasploit-framework/lib/msf/core/payload.rb:14:in `<module:Msf>' from /usr/share/metasploit-framework/lib/msf/core/payload.rb:5:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core/exploit/php_exe.rb:13:in `<module:PhpEXE>' from /usr/share/metasploit-framework/lib/msf/core/exploit/php_exe.rb:10:in `<module:Msf>' from /usr/share/metasploit-framework/lib/msf/core/exploit/php_exe.rb:9:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core/exploit/mixins.rb:18:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core/exploit.rb:224:in `<class:Exploit>' from /usr/share/metasploit-framework/lib/msf/core/exploit.rb:30:in `<module:Msf>' from /usr/share/metasploit-framework/lib/msf/core/exploit.rb:5:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core/auxiliary/ntp.rb:3:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core/auxiliary/mixins.rb:28:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core/auxiliary.rb:16:in `<class:Auxiliary>' from /usr/share/metasploit-framework/lib/msf/core/auxiliary.rb:14:in `<module:Msf>' from /usr/share/metasploit-framework/lib/msf/core/auxiliary.rb:4:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/msf/core.rb:66:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require' from /usr/share/metasploit-framework/lib/metasploit/framework.rb:25:in `<top (required)>' from /usr/share/metasploit-framework/lib/metasploit/framework/database.rb:1:in `require' from /usr/share/metasploit-framework/lib/metasploit/framework/database.rb:1:in `<top (required)>' from /usr/share/metasploit-framework/lib/metasploit/framework/parsed_options/base.rb:17:in `require' from /usr/share/metasploit-framework/lib/metasploit/framework/parsed_options/base.rb:17:in `<top (required)>' from /usr/share/metasploit-framework/lib/metasploit/framework/parsed_options/console.rb:2:in `require' from /usr/share/metasploit-framework/lib/metasploit/framework/parsed_options/console.rb:2:in `<top (required)>' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/inflector/methods.rb:263:in `require' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/inflector/methods.rb:263:in `const_get' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/inflector/methods.rb:263:in `block in constantize' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/inflector/methods.rb:259:in `each' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/inflector/methods.rb:259:in `inject' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/inflector/methods.rb:259:in `constantize' from /usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/string/inflections.rb:66:in `constantize' from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:73:in `parsed_options_class' from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:69:in `parsed_options' from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:47:in `require_environment!' from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:81:in `start' from /usr/bin/msfconsole:48:in `<main>' root@kali:~#

php7 mysql5.7 打架啦

问题是这样的,全新Ubuntu14.04 (aliyun)里安装了mysql 5.7.13 ![Mysql版本信息](https://img-ask.csdn.net/upload/201607/20/1468974692_51088.png) 然后下载编译的PHP7 ./configure 的参数为 --enable-ftp --enable-fpm --with-pdo-mysql=/usr/bin/mysql 提示成功生成Makefile。 继续make时则出现以下错误 ``` ext/pdo_mysql/.libs/pdo_mysql.o: In function `zm_info_pdo_mysql': /root/a/php-7.0.8/ext/pdo_mysql/pdo_mysql.c:162: undefined reference to `mysql_get_client_info' ext/pdo_mysql/.libs/mysql_driver.o: In function `pdo_mysql_check_liveness': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:493: undefined reference to `mysql_ping' ext/pdo_mysql/.libs/mysql_driver.o: In function `pdo_mysql_last_insert_id': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:292: undefined reference to `mysql_insert_id' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_rollback': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:343: undefined reference to `mysql_rollback' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_commit': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:330: undefined reference to `mysql_commit' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_quoter': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:307: undefined reference to `mysql_real_escape_string' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_closer': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:149: undefined reference to `mysql_close' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_autocommit': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:357: undefined reference to `mysql_autocommit' ext/pdo_mysql/.libs/mysql_driver.o: In function `_pdo_mysql_error': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:65: undefined reference to `mysql_stmt_errno' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:93: undefined reference to `mysql_error' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:101: undefined reference to `mysql_stmt_sqlstate' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:67: undefined reference to `mysql_errno' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:103: undefined reference to `mysql_sqlstate' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:93: undefined reference to `mysql_error' ext/pdo_mysql/.libs/mysql_driver.o: In function `pdo_mysql_handle_factory': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:585: undefined reference to `mysql_init' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:627: undefined reference to `mysql_options' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:660: undefined reference to `mysql_options' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:690: undefined reference to `mysql_options' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:703: undefined reference to `mysql_ssl_set' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:730: undefined reference to `mysql_options' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:742: undefined reference to `mysql_options' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:775: undefined reference to `mysql_real_connect' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:670: undefined reference to `mysql_options' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:680: undefined reference to `mysql_options' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_autocommit': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:357: undefined reference to `mysql_autocommit' ext/pdo_mysql/.libs/mysql_driver.o: In function `pdo_mysql_handle_factory': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:703: undefined reference to `mysql_ssl_set' ext/pdo_mysql/.libs/mysql_driver.o: In function `pdo_mysql_get_attribute': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:444: undefined reference to `mysql_stat' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:426: undefined reference to `mysql_get_client_info' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:430: undefined reference to `mysql_get_server_info' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:434: undefined reference to `mysql_get_host_info' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_doer': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:261: undefined reference to `mysql_real_query' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:265: undefined reference to `mysql_affected_rows' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:274: undefined reference to `mysql_next_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:277: undefined reference to `mysql_store_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:273: undefined reference to `mysql_more_results' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:279: undefined reference to `mysql_free_result' ext/pdo_mysql/.libs/mysql_driver.o: In function `mysql_handle_preparer': /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:183: undefined reference to `mysql_get_server_version' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:200: undefined reference to `mysql_stmt_init' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:208: undefined reference to `mysql_stmt_prepare' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:227: undefined reference to `mysql_stmt_param_count' /root/a/php-7.0.8/ext/pdo_mysql/mysql_driver.c:211: undefined reference to `mysql_errno' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_cursor_closer': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:902: undefined reference to `mysql_free_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:907: undefined reference to `mysql_stmt_free_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:913: undefined reference to `mysql_next_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:916: undefined reference to `mysql_store_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:911: undefined reference to `mysql_more_results' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:918: undefined reference to `mysql_free_result' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_fill_stmt_from_result': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:135: undefined reference to `mysql_affected_rows' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:142: undefined reference to `mysql_store_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:149: undefined reference to `mysql_num_rows' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:150: undefined reference to `mysql_num_fields' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:151: undefined reference to `mysql_fetch_fields' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:140: undefined reference to `mysql_use_result' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_next_rowset': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:408: undefined reference to `mysql_num_fields' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:410: undefined reference to `mysql_stmt_free_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:414: undefined reference to `mysql_free_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:418: undefined reference to `mysql_more_results' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:430: undefined reference to `mysql_next_result' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_fetch': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:632: undefined reference to `mysql_stmt_fetch' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:661: undefined reference to `mysql_fetch_row' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:672: undefined reference to `mysql_fetch_lengths' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:665: undefined reference to `mysql_errno' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_dtor': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:55: undefined reference to `mysql_free_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:63: undefined reference to `mysql_stmt_close' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:95: undefined reference to `mysql_next_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:99: undefined reference to `mysql_store_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:93: undefined reference to `mysql_more_results' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:101: undefined reference to `mysql_free_result' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_execute_prepared_libmysql': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:170: undefined reference to `mysql_stmt_bind_param' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:175: undefined reference to `mysql_stmt_errno' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_execute': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:328: undefined reference to `mysql_free_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:332: undefined reference to `mysql_real_query' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_execute_prepared_libmysql': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:170: undefined reference to `mysql_stmt_execute' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_set_row_count': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:121: undefined reference to `mysql_stmt_affected_rows' ext/pdo_mysql/.libs/mysql_statement.o: In function `pdo_mysql_stmt_execute_prepared_libmysql': /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:186: undefined reference to `mysql_stmt_result_metadata' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:189: undefined reference to `mysql_fetch_fields' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:200: undefined reference to `mysql_num_fields' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:254: undefined reference to `mysql_stmt_bind_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:261: undefined reference to `mysql_stmt_store_result' /root/a/php-7.0.8/ext/pdo_mysql/mysql_statement.c:209: undefined reference to `mysql_stmt_attr_set' collect2: error: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 ```

php获取文件夹内所有文件

我想要用php实现一个网页获取一个文件夹 E:\avi里所有后缀是avi和pdf文件的路径,然后把超链接放到网页。 文件夹avi可能是在二级或更高的路径,就是可能E:\avi\1.avi E:\1\x\1.avi 我需要 名字.avi路径用相对路径 希望大神可以给源码

如何获取public_html文件夹的绝对路径?

<div class="post-text" itemprop="text"> <pre><code>$_SERVER['DOCUMENT_ROOT'] </code></pre> <p>returns<br></p> <pre><code>/usr/local/apache/htdocs/ </code></pre> <p>is there a way to get</p> <pre><code>/home/user/public_html/ </code></pre> <p>The problem is that I have to write a script which can be in the public_html folder or a sub-folder of the public_html folder. The script should save uploaded files into a folder inside public_html directory(say images). In other words let us say that my file is test.php and the path to it is </p> <pre><code>/home/user/public_html/test/test.php. </code></pre> <p>And there is a folder </p> <pre><code>/home/user/public_html/images </code></pre> <p>where files uploaded via test.php have to be saved. I don't know where the test.php file will be run. For example it can be at the path </p> <pre><code>/home/user/public_html/test/another-dir/test.php </code></pre> <p>How do I get the path to the images folder without knowing where the test.php file will be?</p> </div>

如何通过一个打开的文件夹句柄获得文件夹的完整路径

我在msdn上看到了一个例子,可以从一个打开的文件句柄获取到文件名,但是 那种方法对于文件夹的句柄是没有用的,msdn示例的链接地址: http://msdn.microsoft.com/zh-cn/library/windows/desktop/aa366789(v=vs.85).aspx 我期望能够从一个文件夹句柄得到该文件夹的完成路径,不知道谁可以帮助我!

php编译make后找不到libpng

#./configure --prefix=/usr/local/webserver/php5613 --with-config-file-path=/usr/local/webserver/php5613/etc --with-apxs2=/usr/local/webserver/apache24/bin/apxs --with-mysql=/usr/local/webserver/mysql/ --with-libxml-dir=/usr/local/webserver/libxml2/ --with-png-dir=/usr/local/webserver/libpng/ --with-jpeg-dir=/usr/local/webserver/jpeg9/ --with-freetype-dir=/usr/local/webserver/freetype/ --with-gd=/usr/local/webserver/gd/ --with-zlib-dir=/usr/local/webserver/zlib/ --with-mcrypt=/usr/local/webserver/libmcrypt/ --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-xpm-dir=/usr/lib/ --enable-soap --enable-mbstring=all --enable-sockets #make 报下面错误: grep: /usr/local/webserver/lib/libpng16.la: No such file or directory /bin/sed: can't read /usr/local/webserver/lib/libpng16.la: No such file or directory libtool: link: `/usr/local/webserver/lib/libpng16.la' is not a valid libtool archive make: *** [libphp5.la] 错误 1

LAMP环境搭建 编译PHP出错

编译命令:./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql 错误信息: configure: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more informatio 添加--with-zlib-dir之后命令:./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/lib 错误信息: configure: error: mysql configure failed. Please check config.log for more information. 执行rpm -aq|grep zlib命令显示:zlib-1.2.1.2-1.2 zlib-devel-1.2.1.2-1.2 将php的路径去掉 还是出错

从php中包含的文件中获取父文件的路径,我不需要文件夹路径,而是包含页面的完整路径

<div class="post-text" itemprop="text"> <p>I have a php file that could be included in different places. I need to have some rule on what to show depending on the including file.</p> <p>Using <code>$_SERVER['REQUEST_URI']</code> is returning the path of the page itself not the parent file that's including it.</p> </div>

php如何获取文件夹里所有avi文件

我想要用php实现一个网页获取一个文件夹 E:\avi里所有后缀是avi和pdf文件的路径,然后把超链接放到网页。 文件夹avi可能是在二级或更高的路径,就是可能E:\avi\1.avi E:\1\x\1.avi 我需要 <a herf="路径">名字.avi</a>路径用相对路径

ghost 博客搭建遇到问题

环境: 系统: debian 7.8 php apache mysql 描述: 默认的是sqlite3 报错,我准备用 mysql 连接ghost 修改ghost 文件下config.js production: { url: 'http://blog.koubeidai.com', mail: {}, database: { client: 'mysql', connection: { host : 'localhost', user : '', password : '', database : 'ghost', charset : 'utf8' }, debug: false }, server: { // Host to be passed to node's `net.Server#listen()` host: '127.0.0.1', // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT` port: '2368' } }, 在ghost文件夹下输入: npm install --production(卡在这一步了) > sqlite3@3.0.4 install /home/bags/ghost/node_modules/sqlite3 > node-pre-gyp install --fallback-to-build child_process: customFds option is deprecated, use stdio instead. make: Entering directory `/home/bags/ghost/node_modules/sqlite3/build' ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3080701/sqlite3.c TOUCH Release/obj.target/deps/action_before_build.stamp CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3080701/sqlite3.o AR(target) Release/obj.target/deps/sqlite3.a COPY Release/sqlite3.a CXX(target) Release/obj.target/node_sqlite3/src/database.o ../src/database.cc: In static member function 'static void node_sqlite3::Database::New(const v8::FunctionCallbackInfo<v8::Value>&)': ../src/database.cc:134:71: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>, v8::PropertyAttribute)' ../src/database.cc:134:71: note: candidates are: In file included from /root/.node-gyp/0.12.0/src/node.h:61:0, from ../src/database.cc:2: /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note: bool v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>) /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note: candidate expects 2 arguments, 3 provided /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note: bool v8::Object::Set(uint32_t, v8::Handle<v8::Value>) /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note: candidate expects 2 arguments, 3 provided ../src/database.cc:135:69: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::Integer>, v8::PropertyAttribute)' ../src/database.cc:135:69: note: candidates are: In file included from /root/.node-gyp/0.12.0/src/node.h:61:0, from ../src/database.cc:2: /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note: bool v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>) /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note: candidate expects 2 arguments, 3 provided /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note: bool v8::Object::Set(uint32_t, v8::Handle<v8::Value>) /root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note: candidate expects 2 arguments, 3 provided ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginOpen(node_sqlite3::Database::Baton*)': ../src/database.cc:145:9: warning: unused variable 'status' [-Wunused-variable] ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginClose(node_sqlite3::Database::Baton*)': ../src/database.cc:230:9: warning: unused variable 'status' [-Wunused-variable] ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginExec(node_sqlite3::Database::Baton*)': ../src/database.cc:509:9: warning: unused variable 'status' [-Wunused-variable] ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginLoadExtension(node_sqlite3::Database::Baton*)': ../src/database.cc:610:9: warning: unused variable 'status' [-Wunused-variable] make: *** [Release/obj.target/node_sqlite3/src/database.o] 错误 1 make: Leaving directory `/home/bags/ghost/node_modules/sqlite3/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12) gyp ERR! System Linux 3.2.0-4-amd64 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=sqlite3" "--configuration=Release" "--module_name=node_sqlite3" "--version=3.0.4" "--major=3" "--patch=4" "--runtime=node" "--node_abi=node-v14" "--platform=linux" "--target_platform=linux" "--arch=x64" "--target_arch=x64" "--module_main=./lib/sqlite3" "--host=https://mapbox-node-binary.s3.amazonaws.com/" "--module_path=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64" "--module=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node" "--remote_path=./sqlite3/v3.0.4/" "--package_name=node-v14-linux-x64.tar.gz" "--staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz" "--hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/" "--hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz" gyp ERR! cwd /home/bags/ghost/node_modules/sqlite3 gyp ERR! node -v v0.12.0 gyp ERR! node-gyp -v v1.0.2 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --name=sqlite3 --configuration=Release --module_name=node_sqlite3 --version=3.0.4 --major=3 --patch=4 --runtime=node --node_abi=node-v14 --platform=linux --target_platform=linux --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.com/ --module_path=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64 --module=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node --remote_path=./sqlite3/v3.0.4/ --package_name=node-v14-linux-x64.tar.gz --staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz --hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/ --hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/bags/ghost/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:76:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:110:17) node-pre-gyp ERR! stack at maybeClose (child_process.js:1008:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5) node-pre-gyp ERR! System Linux 3.2.0-4-amd64 node-pre-gyp ERR! command "node" "/home/bags/ghost/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /home/bags/ghost/node_modules/sqlite3 node-pre-gyp ERR! node -v v0.12.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.1 node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --name=sqlite3 --configuration=Release --module_name=node_sqlite3 --version=3.0.4 --major=3 --patch=4 --runtime=node --node_abi=node-v14 --platform=linux --target_platform=linux --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.com/ --module_path=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64 --module=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node --remote_path=./sqlite3/v3.0.4/ --package_name=node-v14-linux-x64.tar.gz --staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz --hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/ --hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz' (1) npm ERR! Linux 3.2.0-4-amd64 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--production" npm ERR! node v0.12.0 npm ERR! npm v2.5.1 npm ERR! code ELIFECYCLE npm ERR! sqlite3@3.0.4 install: `node-pre-gyp install --fallback-to-build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sqlite3@3.0.4 install script 'node-pre-gyp install --fallback-to-build'. npm ERR! This is most likely a problem with the sqlite3 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-pre-gyp install --fallback-to-build npm ERR! You can get their info via: npm ERR! npm owner ls sqlite3 npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/bags/ghost/npm-debug.log 这个应该如何解决?

PHP执行shell命令无效

$com = '/usr/local/android-sdk-linux/build-tools/28.0.3/apksigner sign --ks /data/auto_apk/jks/kdtq.jks --ks-key-alias game --ks-pass pass:6316877 --key-pass pass:6316877 --out /data/auto_apk_new/kdtq_1001.apk12345/new_kdtq.apk /data/auto_apk_new/kdtq_1001.apk12345/kdtq.apk'; $r = system($com, $output); print_r($output); 上面的shell命令在linux命令行里可以执行,PHP文件在CLI模式下也可以执行,在WEB下执行返回127,找不到命令。PHP是用root权限运行的,这是什么原因?

在linux生存mysql.so的时候 编译不通过

我想生成mysql。so文件让他被PHP调用 过程是这样的 1进入php源代码目录:# cd /usr/ChenShao/php-5.3.1/ 2、再进入要添加的mysql扩展源码目录:# cd ext/mysql/ 2、调用已经编译好的php里面的phpize:# /usr/local/php5/bin/phpize 3、然后configure:# ./configure --with-php-config=/usr/local/php5/bin/php-config --with-mysql=/usr/local/mysql (/usr/local/mysql 为mysql的安装目录) 然后我进行make(谢谢大家!) [root@ovz435 msql]# make /bin/sh /usr/local/php/php-5.2.17/ext/msql/libtool --mode=compile cc -I. -I/usr/local/php/php-5.2.17/ext/msql -DPHP_ATOM_INC -I/usr/local/php/php-5.2.17/ext/msql/include -I/usr/local/php/php-5.2.17/ext/msql/main -I/usr/local/php/php-5.2.17/ext/msql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/Hughes/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/php/php-5.2.17/ext/msql/php_msql.c -o php_msql.lo mkdir .libs cc -I. -I/usr/local/php/php-5.2.17/ext/msql -DPHP_ATOM_INC -I/usr/local/php/php-5.2.17/ext/msql/include -I/usr/local/php/php-5.2.17/ext/msql/main -I/usr/local/php/php-5.2.17/ext/msql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/Hughes/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/php/php-5.2.17/ext/msql/php_msql.c -fPIC -DPIC -o .libs/php_msql.o /usr/local/php/php-5.2.17/ext/msql/php_msql.c:38:18: 错误:msql.h:没有那个文件或目录 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:117: 错误:expected specifier-qualifier-list before ‘m_result’ /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘_delete_query’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:129: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:129: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: 在顶层: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:133: 错误:expected ‘)’ before ‘*’ token /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zm_activate_msql’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:195: 错误:‘msqlErrMsg’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:195: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:195: 错误:所在的函数内只报告一次。) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_query’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:583: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_db_query’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:625: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_list_dbs’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:636: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:636: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:659: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_list_tables’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:670: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:670: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:700: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_list_fields’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:711: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:711: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:742: 警告:传递参数 2 (属于 ‘zend_register_resource’)时将整数赋给指针,未作类型转换 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_error’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:753: 错误:‘msqlErrMsg’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_result’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:762: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:762: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:764: 错误:‘m_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:764: 错误:expected ‘;’ before ‘sql_row’ /usr/local/php/php-5.2.17/ext/msql/php_msql.c:783: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:791: 错误:‘sql_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:799: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:799: 错误:‘tmp_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_num_rows’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:863: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:863: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:870: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_num_fields’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:880: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:880: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:887: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘php_msql_fetch_hash’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:897: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:897: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:898: 错误:‘m_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:898: 错误:expected ‘;’ before ‘msql_row’ /usr/local/php/php-5.2.17/ext/msql/php_msql.c:899: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:899: 错误:‘msql_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:925: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:926: 错误:‘msql_row’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_data_seek’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1004: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1004: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1011: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘php_msql_get_field_name’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1030: 错误:‘INT_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1033: 错误:‘CHAR_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1036: 错误:‘REAL_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1039: 错误:‘IDENT_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1042: 错误:‘NULL_TYPE’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_fetch_field’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1070: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1070: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1071: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1071: 错误:‘msql_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1089: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1107: 错误:‘PRI_KEY_FLAG’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_field_seek’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1121: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1121: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1128: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘php_msql_field_info’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1154: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1154: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1155: 错误:‘m_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1155: 错误:‘msql_field’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1162: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1198: 错误:‘NOT_NULL_FLAG’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1198: 错误:‘PRI_KEY_FLAG’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_free_result’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1282: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1282: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1289: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c: In function ‘zif_msql_affected_rows’: /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1300: 错误:‘m_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1300: 错误:‘msql_result’ 未声明 (在此函数内第一次使用) /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1306: 错误:‘m_query’ 没有名为 ‘result’ 的成员 /usr/local/php/php-5.2.17/ext/msql/php_msql.c:1307: 错误:‘m_query’ 没有名为 ‘af_rows’ 的成员

linux 下安装php的zip扩展报错

再Linux 下安装php的zip扩展 ``` wget http://pecl.php.net/get/zip-1.12.2.tgz #tar zxvf zip-1.12.2.tgz #cd zip-1.12.2 #/opt/php/bin/phpize #./configure --with-php-config=/opt/php/bin/php-config #make ``` make后报错,make: * [php_zip.lo] Error 1 ![图片说明](https://img-ask.csdn.net/upload/201710/12/1507771584_406251.png) ![图片说明](https://img-ask.csdn.net/upload/201710/12/1507771596_471263.png) 尝试过更换其它的zip版本都没有办法。请问下谁知道解决方法呢?感谢了。 0人回答 2人浏览

php5.4.45中用composer安装think-captcha 1*遇到无法安装问题

D:\WWW\dance>composer require topthink/think-captcha 1.* ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Installing topthink/think-captcha (v1.0.7): Downloading (failed) Downloading (failed) Downloading (failed) Failed to download topthink/think-captcha from dist: The "https://api.github.com/repos/top-think/think-captcha/zipball/0c55455df26a1626a60d0dc35d2d89002b741d44" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version Failed to enable crypto failed to open stream: operation failed Now trying to download from source - Installing topthink/think-captcha (v1.0.7): Cloning 0c55455df2 [RuntimeException] Failed to clone https://github.com/top-think/think-captcha.git, git was not found, check that it is installed and i n your PATH env. 'git' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

liunx php编译安装提示 libiconv相关组件不存在

报错信息 ``` ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:973: undefined reference to `libiconv_open' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:1001: undefined reference to `libiconv' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:1115: undefined reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2551: undefined reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_append_bucket': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2702: undefined reference to `libiconv' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2701: undefined reference to `libiconv' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2623: undefined reference to `libiconv' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2577: undefined reference to `libiconv_open' collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 ``` 按照网上的 方式 ``` ./configure --prefix=/application/php5.6.3 \ --with-apxs2=/application/apache/bin/apxs \ --with-mysql=/application/mysql \ --with-iconv-dir=/usr/local/libiconv \ --enable-xml \ --disable-rpath \ --enable-safe-mode \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --enable-mbregex \ --enable-mbstring \ --enable-gd-native-ttf \ --enable-pcntl \ --enable-sockets \ --enable-zip \ --enable-soap \ --enable-short-tags \ --enable-zend-multibyte \ --enable-static \ --enable-ftp ``` 参数加好 make &&make install 试了好几遍都不行 路径明明都配好了 libiconv 找不到 明明 路径是存在的

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

将一个接口响应时间从2s优化到 200ms以内的一个案例

一、背景 在开发联调阶段发现一个接口的响应时间特别长,经常超时,囧… 本文讲讲是如何定位到性能瓶颈以及修改的思路,将该接口从 2 s 左右优化到 200ms 以内 。 二、步骤 2.1 定位 定位性能瓶颈有两个思路,一个是通过工具去监控,一个是通过经验去猜想。 2.1.1 工具监控 就工具而言,推荐使用 arthas ,用到的是 trace 命令 具体安装步骤很简单,大家自行研究。 我的使用步骤是...

学历低,无法胜任工作,大佬告诉你应该怎么做

微信上收到一位读者小涛的留言,大致的意思是自己只有高中学历,经过培训后找到了一份工作,但很难胜任,考虑要不要辞职找一份他能力可以胜任的实习工作。下面是他留言的一部分内容: 二哥,我是 2016 年高中毕业的,考上了大学但没去成,主要是因为当时家里经济条件不太允许。 打工了三年后想学一门技术,就去培训了。培训的学校比较垃圾,现在非常后悔没去正规一点的机构培训。 去年 11 月份来北京找到了一份工...

JVM内存结构和Java内存模型别再傻傻分不清了

JVM内存结构和Java内存模型都是面试的热点问题,名字看感觉都差不多,网上有些博客也都把这两个概念混着用,实际上他们之间差别还是挺大的。 通俗点说,JVM内存结构是与JVM的内部存储结构相关,而Java内存模型是与多线程编程相关,本文针对这两个总是被混用的概念展开讲解。 JVM内存结构 JVM构成 说到JVM内存结构,就不会只是说内存结构的5个分区,而是会延展到整个JVM相关的问题,所以先了解下

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Google 与微软的浏览器之争

浏览器再现“神仙打架”。整理 | 屠敏头图 | CSDN 下载自东方 IC出品 | CSDN(ID:CSDNnews)从 IE 到 Chrome,再从 Chrome 到 Edge,微软与...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

立即提问
相关内容推荐