安装Apache和PHP_[emerg] 8#8: io_setup() failed (38: function not i-程序员宅基地

技术标签: apache  file  module  documentation  php  redhat  

Apache 2 and PHP Installation

The following notes are how I got Apache 2 and PHP 5 (or PHP 4) working together on Linux. These instructions also apply, mostly, for any UNIX-like system, especially other Linux distributions. If you have a recent Linux distribution (say since 2002), you already have Apache 2 and PHP, so you don't need to do this unless you want the latest Apache 2 or PHP release or need to customize the Apache or PHP software. Don't forget to remove (or at least disable) the Apache rpm package if you install your own custom Apache.

Apache 2 Version Tip: Beginning with Apache 2.0.42 the API will be kept stable (yeah!). That means you will NOT have to recompile modules (and possibly upgrade/fix source) every time you install a new Apache release. This assumes you stay in the same Apache release series. For example, upgrading from 2.2.0 to 2.2.2 should work. This will not apply to upgrading to the next series (e.g., "development" 2.3.x or "stable" 2.4.x).

I was only able to get PHP working with Apache 2 as a *.so DSO ("dynamic shared object"), as opposed to compiled into Apache (with a static *.a library). I think DSO is the only way PHP is supported now on Apache 2.

I first used httpd-2.0.43 and php-4.3.0 with RedHat 7.3. I am now using httpd-2.2.3 and php-5.2.0 with SUSE 10.1.

Note: If you have problems with PHP and think it's a recent bug, you may want to consider using the latest http://snaps.php.net/ snapshot. Beware that snapshots frequently have regression and are not for production use. Usually problems are because of mis-configuration, not bugs, so snapshots will probably hurt more than help.

 

  1. Download/unpack Apache2 source from the Apache httpd server website, http://httpd.apache.org/

  2. In the Apache 2 source directory, create a Makefile by typing:
    ./configure --prefix=/usr/local/apache /
    --enable-so /
    --enable-cgi /
    --enable-info /
    --enable-rewrite /
    --enable-speling /
    --enable-usertrack /
    --enable-deflate /
    --enable-ssl /
    --enable-mime-magic
    You only need the enable-so line above. For information on other options, type ./configure --help and see "Compiling and Installing" in the Apache 2 Documentation, http://httpd.apache.org/

  3. Make Apache from the just-created Makefile:
    make
    
  4. If make is successful, install Apache as root:
    make install
    
  5. Download/unpack PHP source from the PHP website, http://www.php.net/
    Pick the latest from the 4.x series or 5.x series.

  6. In the PHP source directory, create a Makefile by typing:
    ./configure /
    
    	--with-apxs2=/usr/local/apache/bin/apxs /
    	--with-mysql /
    	--prefix=/usr/local/apache/php /
    	--with-config-file-path=/usr/local/apache/php /
    	--enable-force-cgi-redirect /
    	--disable-cgi /
    	--with-zlib /
    	--with-gettext /
    	--with-gdbm
    
    You only need the --with-apxs2, and prefix lines. --with-mysql adds MySql, --with-config-file moves the php.ini file location, disable-cgi disables the CGI version, which is not needed if you use Apache modules. It also enables and installs the command line interface (CLI) version. --with-zlib allows use of gzip-type compression, --with-gettext is for internationalization, and --with-gdbm allows access to GDBM databases. For more information, type ./configure --help and see the "Installation" chapter in the PHP Manual, http://ww.php.net/docs.php

  7. Make PHP from the just-created Makefile:
    make
    
  8. If make is successful, type this as root to install PHP:
    make install
    
    If you are not root (I do not perform makes while root, for security and safety reasons), become root and type the following:
    make install-su
    
  9. If file /usr/local/apache/modules/libphp5.so does not exist or is an older version, type this (change this to libphp4.so for PHP 4):
    cp -p .libs/libphp5.so /usr/local/apache/modules
    
  10. Install the php.ini file:
    cp -p php.ini-recommended /usr/local/apache/php/php.ini
    
  11. Add these directives are in /usr/local/apache/conf/httpd.conf (if already there, verify they are correct):
    # Make sure there's only **1** line for each of these 2 directives:
    # Use for PHP 4.x:
    #LoadModule php4_module        modules/libphp4.so
    #AddHandler php-script   php
    
    # Use for PHP 5.x:
    LoadModule php5_module        modules/libphp5.so
    AddHandler php5-script php 
    
    # Add index.php to your DirectoryIndex line:
    DirectoryIndex index.html index.php
    
    AddType text/html       php
    
    # PHP Syntax Coloring
    # (optional but useful for reading PHP source for debugging):
    AddType application/x-httpd-php-source phps
    
    

     

    Note 1: The php documentation recommends AddType application/x-httpd-php php instead of the above. However, it causes problems with the "MultiViews" feature of HTTP. That is, if the .php extension is left off a URL, and with certain browser Accept headers, Apache will not know .php (application/x-httpd-php) is HTML and will return a 406 Not Acceptable error. Using the AddType and AddHandler as shown above fixes this problem. For details see Mark Tranchant's webpage, "Using Apache's MultiViews with PHP whilst avoid 406 errors," and PHP bug 28023.

    Note 2: PHP Syntax coloring isn't required, but it's very nice for looking at your php source while debugging. Here's an example.

    Note 3: just for completeness I'll mention that you should be able to use SetOutputFilter / SetInputFilter instead of AddType, but you can't use both. However, SetOutputFilter / SetInputFilter no longer works for me. It used to work with an earlier PHP 4.x or Apache 2 version, but not with Apache 2.0.47/PHP 4.3.3. I understand this (PHP as an Apache 2 filter) is experimental, so I don't use it anymore:

    <Files *.php>
    	SetOutputFilter PHP
    	SetInputFilter  PHP
    </Files>
    
  12. You're now ready to try it out. Start Apache (httpd) as root:
    /usr/local/apache/bin/apachectl start
    
  13. Perform these sanity checks to verify your install went OK:
    $ /usr/local/apache/bin/httpd -t
    Syntax OK
    
    $ /usr/local/apache/bin/httpd -v
    Server version: Apache/2.2.2
    Server built:   May 29 2006 12:40:55
    
    
    $ /usr/local/apache/bin/httpd -V
    Server version: Apache/2.2.2
    Server built:   May 29 2006 12:40:55
    Server's Module Magic Number: 20051115:2
    Server loaded:  APR 1.2.7, APR-Util 1.2.7
    Compiled using: APR 1.2.7, APR-Util 1.2.7
    Architecture:   32-bit
    Server MPM:     Prefork
      threaded:     no
        forked:     yes (variable process count)
    Server compiled with....
     -D APACHE_MPM_DIR="server/mpm/prefork"
     -D APR_HAS_SENDFILE
     -D APR_HAS_MMAP
     -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
     -D APR_USE_SYSVSEM_SERIALIZE
     -D APR_USE_PTHREAD_SERIALIZE
     -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
     -D APR_HAS_OTHER_CHILD
     -D AP_HAVE_RELIABLE_PIPED_LOGS
     -D DYNAMIC_MODULE_LIMIT=128
     -D HTTPD_ROOT="/usr/local/apache"
     -D SUEXEC_BIN="/usr/local/apache/bin/suexec"
     -D DEFAULT_PIDLOG="logs/httpd.pid"
     -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
     -D DEFAULT_LOCKFILE="logs/accept.lock"
     -D DEFAULT_ERRORLOG="logs/error_log"
     -D AP_TYPES_CONFIG_FILE="conf/mime.types"
     -D SERVER_CONFIG_FILE="conf/httpd.conf"
    
    $ /usr/local/apache/bin/httpd -S
    VirtualHost configuration:
    . . .
    
    $ /usr/local/apache/bin/httpd -l
    Compiled in modules:
      core.c
      . . .
      mod_so.c
    
    $ /usr/local/apache/bin/httpd -M
    Loaded Modules:
    . . .
     php5_module (shared)
    Syntax OK
    
    (the above works for Apache 2.2.x and higher only)
    
    $ ps -ef |grep httpd
    root     24069     1  0 09:17 ?        00:00:08 /usr/local/apache/bin/httpd -k s
    apache   29917 24069  0 15:30 ?        00:00:00 /usr/local/apache/bin/httpd -k s
    . . .
    
    

    Note: on BSD-based UNIX systems, you need to use "ps -aux" instead of "ps -ef".

  14. Access your webserver with telnet. Type HEAD / HTTP/1.0 followed by a blank line:
    $ telnet localhost 80
    Trying 127.0.0.1...
    Connected to localhost (127.0.0.1).
    Escape character is '^]'.
    HEAD / HTTP/1.0
    
    HTTP/1.1 200 OK
    Date: Mon, 29 May 2006 23:28:18 GMT
    Server: Apache/2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.7a PHP/5.1.4
    X-Powered-By: PHP/5.1.4
    Last-Modified: Wed, 15 Mar 2006 06:53:17 GMT
    Vary: Accept-Encoding
    Connection: close
    Content-Type: text/html; charset=ISO-8859-1
    Content-Language: en
    
    Connection closed by foreign host.
    
  15. Access your webserver with your favorite browser. The following is a good test page to use for PHP. You only need the one line in bold is needed to display PHP configuration information. Name the file anything you want, but it must end with .php, such as phpinfo.php, and move the file to your web server content directory (for me /usr/local/apache/htdocs), with read permission set:
    <html>
    <head>
    	<title>PHP Test</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    </head>
    <body>
    	<h1>PHP Test</h1>
    	<p>
    	<b>An Example of PHP in Action</b><br />
    		<?php echo "The Current Date and Time is: <br>";
    			echo date("g:i A l, F j Y.");?>
    	</p>
    
    	<h2>PHP Information</h2>
    	<p>
    		<?php phpinfo(); ?>
    	</p>
    </body>
    </html>
    

php logo Tips and Notes

• Disabling Existing Apache Software

If Apache is already installed with your Linux distribution you have to disable it before installing your own custom version. To do this, type the following under RedHat Linux:

/sbin/chkconfig --del httpd
/etc/init.d/httpd stop
You may also remove the httpd and php rpm packages, and dependent packages, if you wish.

 

• Automatic Startup of Apache

To start Apache automatically, follow these steps:

  • Copy Apache startup file to the startup directory:
    cp /usr/local/apache/bin/apachectl /etc/init.d/
    

     

     

  • Edit /etc/init.d/apachectl by inserting these 2 lines in bold:
    #!/bin/sh
    #
    # chkconfig: - 85 15
    # description: Apache is a Web server used to serve HTML files and CGI.
    #
    # Copyright 2000-2005 The Apache Software Foundation or its licensors, as
    # applicable.
    . . .
    # Apache control script designed to allow an easy command line interface
    # to controlling Apache.  Written by Marc Slemko, 1997/08/23
    . . .
    
  • Enable httpd to startup automatically:
    /sbin/chkconfig --add apachectl
    /sbin/chkconfig --level 2 apachectl on
    
    This works for RedHat Linux, Mandrake, SuSE, and Sun Java Desktop System. The equivalent of chkconfig for Debian is:
    update-rc.d apachectl defaults
    For other distributions, make appropriate softlinks to directories /etc/rc*.d/

  • Reboot Linux to verify Apache starts

[Thanks to Beriah Dutcher and others]

Make doesn't make dynamic library libphp5.so, just static library libphp5.a

First make sure libphp5.so isn't there. It's usually in the libs or .libs subdirectory. Run find from the PHP source directory root: find . -name libphp5.so If that doesn't work, make sure you use the --with-apxs2 option with the correct directory in ./configure. For example:
./configure --with-mysql --with-apxs2=/path/to/apache/apxs
When re-running ./configure always start with a fresh, clean source directory (no object).

(For PHP 4, substitute libphp4.so and libphp4.a for libphp5.so and libphp5.a, respectively.)

PHP 5: My PHP scripts that worked with PHP 4 now ignores input variables

If you have old PHP 4 scripts you don't want to convert to PHP 5, change this line in your php.ini file:

register_long_arrays = On

 

For the long term, you may want to upgrade your PHP software or convert the PHP source code to use new-style variables. E.g., use $_REQUEST[i] instead of $i

PHP 5.2.0 Upgrade from 5.1.x (November 2006)

I had one problem with upgrading from PHP 5.1.x to 5.2.0. The Phorum 3 software I use has a function date_format that now conflicts with a new PHP 5.2 internal function, also called date_format. This new function is used for PHP 5.2.x's new "datetime support". I fixed this by renaming Phorum's date_format function to not conflict with PHP's function. See also PHP 5.2 Update Info for more PHP 5.2 upgrade information.

PHP 5.x: you may need to upgrade libxml2 to use XML

To use PHP 5 and XML (--with-xml), you need the libxml2 library version 2.6.0 or greater. You may need to upgrade if you have an older Linux distribution. Check with rpm -q libxml2
If it's not installed, check your installation disks for the libxml2 package. If it's too old, you can get the library from XMLSoft.org. You will probably need to compile and install it yourself.

PHP 4.3.5 / 4.3.6 / 5.0RC1 PCRE Regression (March 2004)

If you use PHP 4.3.5, 4.3.6, or PHP 5.0 RC1 with PCRE (Perl Regular Expressions, the default), you get a core dump when you try and restart (SIGHUP) Apache (at least with Apache 2.0.49). The cause is from adding a new version of PCRE, 4.5, in PHP. This is fixed in PHP 4.3.7 and 5.0.

The symptom are these messages in error_log (which is also a symptom for lots of other memory-type bugs in Apache):

[Wed Mar 31 17:14:43 2004] [notice] SIGHUP received.  Attempting to restart
[Wed Mar 31 17:14:43 2004] [notice] seg fault or similar nasty error detected in the parent process
[Wed Mar 31 17:14:48 2004] [warn] pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

To fix, upgrade to PHP 4.3.7 or higher, which fixes it (PHP 5.0 or higher also fixes the bug). A workaround is to stop/start Apache, instead of restarting Apache. For details, see PHP bug 27810.

ServerRoot Installation Directory

By default, Apache is installed in ServerRoot, as specified in httpd.conf or the httpd -d option:
ServerRoot "/usr/local/apache"
Some packagers and distributions move the location to /usr/local/httpd or /usr/local/apache2 so check that Apache is installed where you say it is, and check that you don't have two separate Apache installations by mistake.

PHP-required Apache files must be present

PHP expects certain files to be present. They may be missing for some Linux distributions, which tend to separate files among the /var, /etc, and other directories. The apxs program expects to find httpd under the bin directory where apache is installed (by default /usr/local/apache/bin). PHP expects to find the os.h and unixd.h header files under the include directory where apache is installed (by default /usr/local/apache/include).

MySQL

Use the --with-mysql configure option to build PHP with PHP's version of MySql. If you want the system's MySQL, or are also using MySql with another apache module (e.g., mod_perl), use this: with-mysql=/usr

Custom OpenSSL and SSL

When using "--enable-ssl" (i.e, build with OpenSSL), the configure script will try to guess the location of OpenSSL. If you're using your own custom SSL, you must specify the location. For example, "--with-ssl=/usr/local/ssl" (of course, you can use the SSL and PHP that comes with Redhat 9 and other distributions).

Please note that mod_ssl is only for Apache 1.x. Apache 2.x does not use mod_ssl—SSL is built into Apache 2.x.

Jason reports that with RedHat 9 on his system, the make failed at mod_ssl. It needed a missing krb5.h header file. The fix is to Add an environment variable, $CFLAGS, before making PHP. That is:
"-I/usr/kerberos/include/ -L/usr/kerberos/lib"

gdbm
If you get this error when using "--with-gdbm":
configure: error: DBA: Could not find necessary header file(s).
then you are probably missing the gdbm-devel rpm package.

Apache 1.x and Apache 2 Configuration Directives
The "AddModule," "AgentLog," "ReferrerLog," "RefererIgnore," "BindAddress," "ClearModuleList," "Port," "FancyIndexing," "ServerType," "AccessConfig," and "ResourceConfig" directives in Apache 1.x no longer exist in Apache 2. Also, "HAVE_*" httpd.conf definitions no longer exist. Comment them out of your httpd.conf for Apache 2. Most of these directives have been replaced by other directive(s).

Error after glibc library upgrade

Apache should still work after upgrading glibc with security and bug fixes for the same release. If you use another architecture (say from or to i386/i686), you need to recompile. One symptom is an error like this in your Apache error_log:
[error] (38)Function not implemented:

make clean

Kåre Olaussen adds this note: If you're compiling php4 for both Apache 1.3 and Apache 2, use a separate php source directory for each version of Apache. "The module wouldn't load into Apache 2, because I had forgotten to run make clean in between." [Ed. note: I recommend untaring the source from scratch in another directory, that way you are sure no old state information is left behind from previous makes. Do this for any configuration or version changes.]

Enabling register_globals for Apache 2

From Duke: For those of you that are desperately trying to enable register_globals on a per-directory basis using Apache 2 with PHP 4 [or PHP 5] using .htaccess files, the syntax is different from Apache 1.x. In the directory you want to enable register_globals (or pretty much any other on/off setting), add an .htaccess file containing:

php_value register_globals 1
Note that php_flag does not work with Apache 2. Neither does on / off — you must use 0 (off) or 1 (on).

 

[Editor's note: To enable globally, add register_globals=off to your php.ini file.]

To enable register_globals on a per-directory basis, you can add to a <Directory> stanza or create a .htaccess configuration file in the directory. To use .htaccess, you must first enable it by adding AllowOverride All (or some combination of AllowOverride options within the correct <Directory> stanza. Also newer PHP software, such as SquirrelMail, no longer require register_globals to be enabled. Keeping register_globals disalbed makes the system much more secure (as it's harder to set internal php variables through submitting html forms). ]

 

Multi-Processing Module (MPM): don't use multi-threading MPMs

MPMs is how Apache 2 handles multiple web server requests. That is, with multiple processes or multiple threads or some combination. For now, on Linux (and even UNIX) you should only use the (default) prefork module with PHP. This is specified at compile time. Other MPM modules (any involving threads) break PHP. This is partly because PHP uses a great number of external libraries, and many or most of them are not thread-safe or thread-aware. In any case, Linux 2.4 doesn't handle threads efficiently yet—multiple processes are better (this changes with Linux 2.6, or RedHat 9 with 2.6 threads backported to Linux 2.4).

API module structure `php5_module' in file . . . is garbled

If you get a message like this:
httpd: Syntax error on line 195 of /usr/local/apache/conf/httpd.conf: API module
structure `php5_module' in file /usr/local/apache/modules/libphp5.so is garbled
- perhaps this is not an Apache module DSO
it's because your version of PHP wasn't built for the version of Apache you are using (For PHP 4, substitute php4_module . . . libphp4.so). Recompile PHP in a "fresh" source directory (where you haven't built PHP before) and make sure --prefix, --with-config-file and --with-apxs2 points to the correct Apache directories you are using and the libphp4.so file has been copied to your /usr/local/apache/modules directory.

PATH_INFO

Dan Fitzpatrick notes that he uses PATH_INFO for many PHP scripts like /index.php/go/do/something (where parameters are passed to PHP as "fake" subdirectories). He received a 404 Not Found errors with Apache 2 but not Apache 1.3.27. He had to add "AcceptPathInfo On" to file httpd.conf. For details, see http://httpd.apache.org/docs-2.2/mod/core.html#acceptpathinfo

Using <?   ?> style tags in addition to <?php   ?> style tags

If you want to also use the old-style (or MS ASP-like) tags <? and ?> then add this line to your php.ini file. This is the default starting with PHP 5:

short_open_tag = On

 

GD library now built-in PHP

PHP 4.3.0 has gd built-in, just pass --with-gd to PHP configure.

--with-apache

If you don't have Apache source at the default directory at /usr/local/apache, then use --with-apache=DIR with PHP configure, where DIR is the root source directory, This tells PHP where to look for the Apache source.

Redhat 9
Apache 2 and PHP is built-in RedHat 9 (packages httpd 2.0.40, and php 4.2.2). Apache is mostly under /usr/lib/httpd and /usr/sbin/httpd. PHP is at /usr/lib/httpd/modules/libphp4.so For a complete file listing, type: rpm -ql httpd php

For RedHat 9, PHP 4.3.1 gives a compiler errors with RedHat 9 similar to: my_malloc.c:24: undefined reference to `errno'
The problem is with mysql and will have to wait for a fix from them. Until then, add this line:
#include <errno.h>
to the beginning of file ./ext/mysql/libmysql/mysql.h in your PHP source and remake PHP (from scratch).

Notes about Gentoo Linux and Apache2 with PHP

LoadModule php5_module modules/libphp5.so
becomes:
LoadModule php5_module /usr/lib/apache2-extramodules/libphp5.so

To start automatically under Gentoo:
rc-update add apache2 default
(change php5 to php4 for PHP 4)

[Thanks to Phillip Temple]

php logo References

 

php logo Copyright and Disclaimer

 

Copyright 2002-2006 Dan Anderson. All rights reserved.

This document is provided "as is" in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 


[Home]

 

Last updated Wednesday, 05-Sep-2007 09:21:52 PDT.

 

If you have questions or comments, please send a message to Dan Anderson.

 

http://dan.drydog.com/apache2php.html

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/oulix/article/details/2303233

智能推荐

C语言/C++常见习题问答集锦(三十二)之六种图案的字母金字塔_c++字母金字塔-程序员宅基地

文章浏览阅读5.7k次,点赞20次,收藏114次。字母金字塔图案1、A BBB CCCCC DDDDDDD图案2、A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9图案3、A ABA ABCBA ABCDCBA图案4、A BB CCC DDDD EEEEE FFFFFF图案5、A BAB CBABC DCBABCD EDCBABCDE空心字母金字图案6、A B B C C D D EEEEEEEEE_c++字母金字塔

如何点击IE窗口上方的“X关闭符号”,弹出提示窗口呢? -程序员宅基地

文章浏览阅读972次。url:http://www.cnblogs.com/zhangzs8896/archive/2005/12/17/298899.html New Document function test() { return ""; } onbeforeunload="return test();"> _关闭符号

天坑的:Fatal Python error: init_sys_streams: can‘t initialize sys standard streams解决方案_fatal python error: init_sys_streams: can't initia-程序员宅基地

文章浏览阅读1.6w次,点赞7次,收藏18次。【问题描述】今天用pycharm新建工程突然提示:编译环境有问题,简单写了两行代码测试一直有问题, 报错如下:Fatal Python error: init_sys_streams: can’t initialize sys standard streams【原因分析】找了很多解决方案,结合错误提示,还是问题发生在虚拟环境下lib目录中的io.py身上,网上有好多老铁说改文件名字,然而证明并没有什么用,认真看下文件信息和内容发现并无区别,最后突然发现io.py的生成日期不对,恒新鲜,不是新建环境_fatal python error: init_sys_streams: can't initialize sys standard streams

7-4 稀疏矩阵加法 (20 分) pta_稀疏矩阵加法pta-程序员宅基地

文章浏览阅读1.9k次,点赞2次,收藏2次。7-4稀疏矩阵加法(20分)给定两个矩阵A和B,求其和矩阵C=A+B。输入格式:第一行包含两个数Row和Col,分别表示矩阵的行数和列数,A和B的维度是一致的。第二行只有一个数N​1​​,表示接下来要输入的A中的非零元素的个数。接下来是N​1​​行,每一行都是ijA[i,j]这样的形式,表示的A中第i行第j列的元素A[i,j],为了与大多数编程语言保持一致,它..._稀疏矩阵加法pta

【Android 安全】DEX 加密 ( Java 工具开发 | 解压 apk 文件 | 加密生成 dex 文件 | 打包未签名 apk 文件 | 文件解压缩相关代码 )_dex加密-程序员宅基地

文章浏览阅读1.9k次。一、解压 apk 文件、二、加密生成 dex 文件、三、打包未签名 apk 文件、四、完整代码示例、五、文件解压缩相关代码、六、执行结果_dex加密

随便推点

OpenCL使用子缓冲对象(Sub buffer)报错CL_DEVICE_MEM_BASE_ADDR_ALIGN的解决方法_opencl subbuffer-程序员宅基地

文章浏览阅读399次。最近由于新冠疫情原因宅于家中,不得不重新搞个电脑继续毕设之旅,学校所用电脑为i5-6500+Titan xp,在家只能自掏腰包配了个i5-9400f + 1660,CPU升级了下,GPU看看就好。废话不说了,直奔主题。在使用OpenCL创建子缓冲对象时,使用 i5-9400f CPU 作为计算设备会出现 CL_DEVICE_MEM_BASE_ADDR_ALIGN,而对于相同的程序,GPU则..._opencl subbuffer

jupyter notebook版本更新和降低版本命令_jupyternotebook 降版本-程序员宅基地

文章浏览阅读1.2w次。安装更高的版本:pip install -U "notebook>6.0"降低版本pip install -U "notebook<5.0"_jupyternotebook 降版本

Jenkins 部署(Docker)_h: 2: cd: can't cd to /var/jenkins_mount/workspace-程序员宅基地

文章浏览阅读6.4k次,点赞6次,收藏43次。环境docker v20.10.6 + jenkins/jenkins(image)部署1. 下载镜像docker pull jenkins/jenkins2. 创建工作目录在服务器创建 Jenkins 工作目录 /var/jenkins_mount 并授权权限,启容器时将 jenkins 容器目录挂载到这个目录上mkdir -p /var/jenkins_mountchmod 777 /var/jenkins_mount3. 启动容器docker run -d -p 1024_h: 2: cd: can't cd to /var/jenkins_mount/workspace/gtstorageweb

MySQL和hive建表区别,Hive中創建表(hive的使用和MySQL的使用很相似)-程序员宅基地

文章浏览阅读262次。CREATE TABLE語句(不區分大小寫)Create Table是用於在Hive中創建表的語句,語法和示例如下:語法:CREATE [TEMPORARY] [EXTERNAL] TABLE [IF NOT EXISTS] [db_name.] table_name[(col_name data_type [COMMENT col_comment], ...)][COMMENT table_co..._hive create table stored as mysql

解决php因内存不足httpd.exe错误方法!_httpd.exe重启不起来-程序员宅基地

文章浏览阅读246次。1,修改 php.ini将memory_limit由 8M 改成 16M(或更大),重启apache服务2,在PHP 文件中 加入 ini_set(”memory_limit”,”100M”);注意:为了系统的其它资源的正常使用 请您不要将 memory_limit设置太大,其中-1为不限3,修改.htaccess 文档(前提是该目录支持.htaccess)在文档中新增一句:p_httpd.exe重启不起来

分布式系统设计_分布式系统的设计审查清单-程序员宅基地

文章浏览阅读201次。分布式系统设计This article was originally published on my website — https://kislayverma.com/programming/design-review-checklist-for-distributed-systems/ 本文最初发布在我的网站上-https: //kislayverma.com/programming/desi...

推荐文章

热门文章

相关标签