centos中安装nginx后,怎样配置wordpress

centos中安装nginx后,怎样配置wordpress

nginx直接访问,是安装成功了

可是不知道怎么配置wp呀

2个回答

你把下下来的wp包解压 放到服务器的站点目录下 然后访问 你的域名或ip地址/wordpress/wp-admin/install.php 跟着他一步一步安装就行了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
在Nginx上安装Wordpress时出错

<div class="post-text" itemprop="text"> <p>I'm trying to install a wordpress site in a Linux VPS with LEMP Setup. So far I've done setting up the wordpress files and setting ownership for nginx user/group on the WP directory/files, but when I go to the address to access the installation page for WP (<a href="https://domain.tld/wp-admin/install.php" rel="nofollow">https://domain.tld/wp-admin/install.php</a>), I end up with a php file download instead.</p> <p>Here's my virtual host configuration for the WP site:</p> <p></p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>server { listen 80; server_name domain.tld; return 301 https://$server_name$request_uri; } server { listen 443 ssl; ssl on; ssl_certificate /directory/to/crt; ssl_certificate_key /directory/to/key; server_name domain.tld; root /var/www/html/domain.tld; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?q=$uri&amp;$args; } rewrite /wp-admin$ $scheme://$host$uri/ permanent; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; } }</code></pre> </div> </div> <p>EDIT: I tried it in Firefox, and it's acting differently than in Chrome. The install.php page instead ends up in an error page like this:</p> <blockquote> <p>An error occurred.</p> <p>Sorry, the page you are looking for is currently unavailable. Please try again later.</p> <p>If you are the system administrator of this resource then you should check the &gt; error log for details.</p> <p>Faithfully yours, nginx.</p> </blockquote> </div>

Nginx + Wordpress页面或帖子URL返回拒绝访问

<div class="post-text" itemprop="text"> <p>I have a <strong>local development environment</strong> with the followings installed:</p> <ul> <li>Nginx 1.8.1</li> <li>Wordpress 4.5.1</li> <li>PHP 5.6.20</li> </ul> <p>In <em>nginx.conf</em> I included the /etc/nginx/conf.d/*.conf to successfully separate config files from each other. I have yet <strong>only one config file which contains configurations to all of my localhost websites from "phpmyadmin" to under development wordpress sites and my goal is to reach them as directories properly</strong>. I'm sure that I have problems in my poorly made nginx configuration, probably I should define a rewrite rule for url parameters but I can't find a solution:</p> <pre><code>server { listen 80; server_name localhost; access_log /var/log/nginx/localhost-access_log main; error_log /var/log/nginx/localhost-error_log info; root /var/www/localhost/htdocs/; index index.php index.html index.htm; location ~ \.php$ { # Test for non-existent scripts or throw a 404 error # Without this line, nginx will blindly send any request ending in .php to php-fpm try_files $uri =404; include /etc/nginx/fastcgi.conf; fastcgi_pass unix:run/php-fpm.socket; } location /phpmyadmin { alias /var/www/localhost/htdocs/phpmyadmin; access_log /var/log/nginx/phpmyadmin-access_log main; error_log /var/log/nginx/phpmyadmin-error_log info; } location /samplewordpress { alias /var/www/localhost/htdocs/samplewordpress; access_log /var/log/nginx/samplewordpress-access_log main; error_log /var/log/nginx/samplewordpress-error_log info; } location /szpetra { alias /var/www/localhost/htdocs/szpetra; access_log /var/log/nginx/szpetra-access_log main; error_log /var/log/nginx/szpetra-error_log info; } </code></pre> <p>}</p> <p>I can log in to the admin page and everything works fine, but after I try to load a page or a post, it returns me an "Access denied" message.</p> <p>Any ideas to solve this problem while I can keep the website in directories?</p> </div>

从Apache转换为Nginx + PHP-FPM后的Wordpress设置

<div class="post-text" itemprop="text"> <p>I have a site that is hosted on a server that uses PHP, Apache. I would like to migrate this site another host that is running on PHP-FPM and Nginx. Obviously, changing the nameservers, mysql dump and transferring the actual wp folder is the easier part. But, I would like to know what settings to modify before migrating the site. </p> <p>As far as I know, the only thing I have to worry about is pretty urls. I may be able to do <code>try_files $uri $uri/ /index.php?$query_string;</code> if it works. If not however, the I will risk the site being defaces for several hours before reversing the nameserver to it's original state. </p> </div>

您的PHP似乎没有安装运行WordPress所必需的MySQL扩展。

wordpress要的都有了,为啥还是说缺少东西啊,哪位大哥,可以解惑下不,万分感谢。php用的7.3.12;mysql用的8.0.13;apache用的2.4.6 (CentOS);nginx用的1.17.6; ![图片说明](https://img-ask.csdn.net/upload/201912/30/1577671230_409648.png) ![图片说明](https://img-ask.csdn.net/upload/201912/30/1577671213_738187.png)

centos7.5搭建wordpress5.3.2数据库错误(求大佬解答!!!)

![图片说明](https://img-ask.csdn.net/upload/202002/08/1581145046_166984.png)<br /> ### **就像图片一样,查看了很多文章,无法解决。** #####**我使用阿里云服务器(centos7.5操作系统,系统安装了php7.3.14和MySQL8.0.19)**(非云数据库)<br /> 创建了专用数据库和有调用权限的账户,也测试过用Navicat都可以登录,数据库账户密码正确,安全规则端口有开放,防火墙和SELinux默认关闭了,在本地尝试搭建是可以连接数据库的, 因为是在服务器内搭建MySQL,地址栏也尝试过127.0.0.1或公网ip亦或者加上端口3306等,都无法实现通过这一步,也试过自建wp-config.php文件,实在想不到解决方法,请求各位帮助!!!感谢<br /> (有一个疑惑,我在网站根目录创建了测试MySQL数据库的php文件,但每次都输出连接成功,无论账户是否正确) (但我自建wo-config.php文件时,网页会显示) ####建立数据库连接时出错,而没有下面一大段文字 求助各位路过的朋友,愿闻其详,感谢!!!

Nginx显示404而不是php页面

<div class="post-text" itemprop="text"> <p>I have nginx installed and if I go to uberdrivingparttime.app/ I get the usual "Welcome to nginx!" screen. I put an index.php in the folder with phpinfo(); and when I go to uberdrivingparttime.app/index.php, I get a 404! Here is my server blcok from config. Hopefully someone knows what's up!</p> <pre><code>server { listen 80; server_name www.uberdrivingparttime.com uberdrivingparttime.com; access_log /srv/www/uberdrivingparttime.com/logs/access.log; error_log /srv/www/uberdrivingparttime.com/logs/error.log; location / { root /srv/www/uberdrivingparttime.com/public_html; index index.html index.htm index.php; } location ~ \.php$ { include /etc/nginx/fastcgi_params; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/uberdrivingparttime.com/public_html$fastcgi_script_name; } } </code></pre> </div>

nginx要求浏览器下载index.php而不是正常服务

<div class="post-text" itemprop="text"> <p>I'm a student just learning about nginx so please bear with me. I've just set up a LEMP stack and installed WordPress by following these guides: <a href="https://www.linode.com/docs/websites/cms/how-to-install-and-configure-wordpress" rel="nofollow">https://www.linode.com/docs/websites/cms/how-to-install-and-configure-wordpress</a> <a href="https://www.linode.com/docs/websites/lemp/lemp-server-on-centos-7-with-fastcgi" rel="nofollow">https://www.linode.com/docs/websites/lemp/lemp-server-on-centos-7-with-fastcgi</a></p> <p>However, when I access my domain where my index should be, I just get a popup to download my index.php. As far as the guides say, everything in my configurations is correct and I've tried making some changes to no avail. Here are my configs:</p> <p>tburg.io.conf:</p> <pre><code>server { listen 80; server_name www.tburg.io tburg.io; access_log /var/www/tburg.io/logs/access.log; error_log /var/www/tburg.io/logs/error.log; location / { root /var/www/tburg.io/public_html/; index index.php; } } </code></pre> <p>nginx.conf:</p> <pre><code>user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } } </code></pre> <p>From what I've read, it seems like maybe nginx isn't using fastcgi to parse PHP the way it's supposed to? However, none of the previous iterations of this question seem to fit the way I've got nginx configured, but it's unclear what I'm doing wrong. Thanks for your help!</p> </div>

在Centos 7 VestaCP + NGINX + PHP-FPM上的/ wp-admin / network中的WordPress多站点重定向循环

<div class="post-text" itemprop="text"> <p>I've runned across issue with <em>Wordpress Multisite</em>.</p> <p>The project is <strong>WordPress Multisite with Subdomains</strong>, running on the same <code>/</code> root folder.</p> <ol> <li><strong>Multisite #1</strong>: <a href="https://one.sub.domain.com" rel="nofollow noreferrer">https://one.sub.domain.com</a></li> <li><strong>Multisite #2</strong>: <a href="https://two.sub.domain.com" rel="nofollow noreferrer">https://two.sub.domain.com</a></li> <li><strong>Multisite #3</strong>: <a href="https://three.sub.domain.com" rel="nofollow noreferrer">https://three.sub.domain.com</a></li> <li><strong>Main Domain</strong>: <a href="https://sub.domain.com" rel="nofollow noreferrer">https://sub.domain.com</a></li> </ol> <p>VPS is running Centos 7 with VestaCP. We are using NGINX for web-service. Project runs via SSL (https://).</p> <p>Basically whenever I try to visit <strong>Main Domain</strong> Network Dashboard <a href="https://sub.domain.com/wp-admin/network" rel="nofollow noreferrer">https://sub.domain.com/wp-admin/network</a> i get redirection error.</p> <blockquote> <p>The page isn’t redirecting properly</p> </blockquote> <p>I've checked and outruled following possible issues:</p> <ul> <li>Not a file/folder permission issue (files have <code>0644</code> and folders <code>0755</code> + it's assigned to <em>VestaCP</em> username <code>domain_user</code>)</li> <li>Not a WordPress configuration or database error.</li> <li>All <em>nginx</em> and <em>php</em> log files are empty/no errors showing.</li> </ul> <p>I suspect it's due to issue in nginx <code>subdomain.domain.ssl.conf</code> config file but I can't figure out what exactly. Here is the content of the config file - it is by default the <strong>VestaCP Web Template</strong>: <code>Wordpress2_rewrite</code></p> <pre><code>server { listen 37.201.93.62:443; server_name sub.domain.com one.sub.domain.com two.sub.domain three.sub.domain; root /home/domain_user/web/sub.domain.com/public_html; index index.php index.html index.htm; access_log /var/log/nginx/domains/sub.domain.com.log combined; access_log /var/log/nginx/domains/sub.domain.com.bytes bytes; error_log /var/log/nginx/domains/sub.domain.com.error.log error; ssl on; ssl_certificate /home/domain_user/conf/web/ssl.sub.domain.com.pem; ssl_certificate_key /home/domain_user/conf/web/ssl.sub.domain.com.key; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location / { try_files $uri $uri/ /index.php?$args; if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { expires max; } location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass 127.0.0.1:9002; fastcgi_index index.php; include /etc/nginx/fastcgi_params; } } error_page 403 /error/404.html; error_page 404 /error/404.html; error_page 500 502 503 504 /error/50x.html; location /error/ { alias /home/domain_user/web/sub.domain.com/document_errors/; } location ~* "/\.(htaccess|htpasswd)$" { deny all; return 404; } location /vstats/ { alias /home/domain_user/web/sub.domain.com/stats/; include /home/domain_user/web/sub.domain.com/stats/auth.conf*; } include /etc/nginx/conf.d/phpmyadmin.inc*; include /etc/nginx/conf.d/phppgadmin.inc*; include /etc/nginx/conf.d/webmail.inc*; include /home/domain_user/conf/web/nginx.sub.domain.com.conf*; } </code></pre> <p>This works fine on <code>/wp-admin</code> hovewer not on <code>/wp-admin/network</code> URLS This is configuration <code>wp-config.php</code> file content:</p> <pre><code>&lt;?php /** * The base configuration for WordPress * * The wp-config.php creation script uses this file during the * installation. You don't have to use the web site, you can * copy this file to "wp-config.php" and fill in the values. * * This file contains the following configurations: * * * MySQL settings * * Secret keys * * Database table prefix * * ABSPATH * * @link https://codex.wordpress.org/Editing_wp-config.php * * @package WordPress */ // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'dbname'); /** MySQL database username */ define('DB_USER', 'root'); /** MySQL database password */ define('DB_PASSWORD', 'pass'); /** MySQL hostname */ define('DB_HOST', 'localhost'); /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', ''); /**#@+ * Authentication Unique Keys and Salts. * * Change these to different unique phrases! * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */ define('AUTH_KEY', 'ARhaa6zreusFJ2VWkuP+l+v]&amp;JEa3kQ|HUn4[|PA:E%k&amp;B|J_mm-?s---&amp;Hew0x7'); define('SECURE_AUTH_KEY', '$23xN:I#`0vQDff_t5Ogk*--h,:^@-0&gt;r6_#,eQL=bc(##uwO&amp;+|i]I&lt;7[KpB%.?'); define('LOGGED_IN_KEY', '9c3qJwhQxx:`|gP^.Y6&gt;d{.;(,95#x@fgHH~#/?&gt;K_jie&lt;iz$mgD1E y;!|Nr~LV'); define('NONCE_KEY', '&lt;8Dh+67o;Pg7m_=++wa!0G+~H$p#Fq|ytwA,fBu~e}9`P.m|;?2&amp;-^wM@Rq~[=?&lt;'); define('AUTH_SALT', ')*YP~hQ]sRn0;^+ApMmj/$);&lt;~?:&gt;vHhc080or&lt;}MRM$a4#%*CEkC//;~GAFzP^-'); define('SECURE_AUTH_SALT', 'uX|45M7~=xKJo`GIoE|:;A[Dl2Sg.Z?w^+HfgLMF3*f5`h*&gt;MT] j7.% X_t6n{7'); define('LOGGED_IN_SALT', 'I!NZC^][EM-&lt;+d_6j3G{l2-0ba16YEM-&amp;z$|Y`8qM&gt;/&lt;M]GPz)::~b/|+xPigr?u'); define('NONCE_SALT', '-Vw#PgM@)P|2+U_x]J! 4+F-IZpe+y@Z~W}({D lPOHTH8hq%=#mse.77Ziw@);{'); /**#@-*/ /** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each * a unique prefix. Only numbers, letters, and underscores please! */ $table_prefix = 'wp_'; /** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. * * For information on other constants that can be used for debugging, * visit the Codex. * * @link https://codex.wordpress.org/Debugging_in_WordPress */ define('WP_DEBUG', true); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); define('WP_MEMORY_LIMIT', '256M'); /* Multisite */ define( 'WP_ALLOW_MULTISITE', true ); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); define('DOMAIN_CURRENT_SITE', 'sub.domain.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); define('ALLOW_UNFILTERED_UPLOADS', true); define('ADMIN_COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIEPATH', ''); define('SITECOOKIEPATH', ''); if ( $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) { $_SERVER['HTTPS'] = 'on'; $_SERVER['SERVER_PORT'] = 443; } /* That's all, stop editing! Happy blogging. */ /** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php'); </code></pre> <p>I've double checked - this config works fine and doesn't cause any issue.</p> <p>At this point I'm really lost and can't figure out how to fix the issue. Whenever I try to visit <a href="https://sub.domain.com/wp-admin/network/update-core.php" rel="nofollow noreferrer">https://sub.domain.com/wp-admin/network/update-core.php</a> i am redirected to <a href="https://sub.domain.com/wp-admin/network" rel="nofollow noreferrer">https://sub.domain.com/wp-admin/network</a> and get redirection error: <a href="https://i.stack.imgur.com/Juwod.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Juwod.jpg" alt="enter image description here"></a></p> <p>I'm hoping on your help! Thanks in advance.</p> <p><strong>[EDITED]</strong></p> <p>I just noticed when visiting <a href="https://one.sub.domain.com" rel="nofollow noreferrer">https://one.sub.domain.com</a> Dashboard and hovering for Network link, it returns <a href="https://wp-admin/network/" rel="nofollow noreferrer">https://wp-admin/network/</a> which clearly shows misconfiguration of nginx. </p> <p><strong>[Possible issue &amp; solution]</strong></p> <p>Soo i debuged once again and my <code>wp-content/debug.log</code> contained these lines</p> <pre><code>[07-Jan-2019 23:55:19 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:19 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:19 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:19 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:19 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:20 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:20 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:20 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:20 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:20 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:21 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:21 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:21 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:21 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:21 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:22 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:22 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:22 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:22 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 [07-Jan-2019 23:55:22 UTC] PHP Notice: Trying to get property 'domain' of non-object in /home/domain_user/web/sub.domain.com/public_html/wp-admin/network/admin.php on line 20 </code></pre> <p>And in <code>/wp-admin/network/admin.php</code> file I commented out <code>line 20</code>:</p> <pre><code>$redirect_network_admin_request = 0 !== strcasecmp( $current_blog-&gt;domain, $current_site-&gt;domain ) || 0 !== strcasecmp( $current_blog-&gt;path, $current_site-&gt;path ); </code></pre> <p>which fixed the issue, but clearly it will mess up the <strong>Network Admin Request Redirection</strong> soo now the question is - <strong>HOW TO FIX THIS PROPERLY?</strong></p> </div>

在CentOS 7中设置Php的默认版本

<div class="post-text" itemprop="text"> <p>I have two versions of PHP in opt/remi folder php56 and php72 but when I <code>php -v</code> on cmd it shows <code>PHP 5.6.24 (cli) (built: Jul 21 2016 07:33:38) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans </code> how to set default version to PHP 7.2</p> </div>

如何在nginx中使用_GET参数获得正确的try_files $ uri指令

<div class="post-text" itemprop="text"> <p>I just migrated a site from apache to nginx, and am very pleased so far. However, the server doesn't seem to recognize a $_GET parameter.</p> <p>I've read that the answer is to change the try_files directive to:</p> <pre><code>location / { try_files $uri $uri/ /index.php?$query_string; } </code></pre> <p>But this isn't working for me. I suspect it's because the query string I'm using is a few directories in, with the url something like:</p> <pre><code>http://www.mysite.com/thedirectory/thefile?sortby=director </code></pre> <p>I just can't tweak the try_files directive to work in that instance, and the documentation seems sparse or obsolete.</p> <p>Any ideas? If I don't get this resolved, I'm going to have to go back to Apache. </p> </div>

nginx没有加载(包括additional-hosts / * .conf;)不会更改目录? centos 7

<div class="post-text" itemprop="text"> <p>I'm fairly new to Linux and I'm having a little trouble setting up my web server... I am using LEMP with Varnish and phpMyAdmin. The server is running and I can access phpMyAdmin over https etc. Now I'm trying to setup Wordpress on another directory using the include /directory/*.conf; however it doesn't seem to load the file(s). It will only load the default directory set in nginx.conf </p> <p>Here's my nginx.conf,</p> <pre><code>user nginx; worker_processes 4; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; include /etc/nginx/v-hosts/*.conf; index index.php index.html index.htm; server { listen 127.0.0.1:8080; root /usr/share/nginx/html; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } location ~ \.php$ { root /usr/share/nginx/html; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } location ~* ^/stolenmx.com/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /srv/www/; } location ~ \.php$ { root /usr/share/nginx/html; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } } server { listen 443; client_max_body_size 80M; ssl on; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root /usr/share/nginx/html; index index.html index.htm; } location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } location ~ \.php$ { root /usr/share/nginx/html; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } } } </code></pre> <p>And here's my file i'm trying to load for wordpress, </p> <pre><code>server { server_name stolenmx.com; listen 8080; access_log /var/log/nginx/stolenmx.com-access.log; error_log /var/log/nginx/stolenmx.com-error.log; root /srv/www/stolenmx.com; location / { index index.php; } # Disable favicon.ico logging location = /favicon.ico { log_not_found off; access_log off; } # Allow robots and disable logging location = /robots.txt { allow all; log_not_found off; access_log off; } # Enable permalink structures if (!-e $request_filename) { rewrite . /index.php last; } # Handle php requests location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/stolenmx.com$fastcgi_script_name; } # Disable static content logging and set cache time to max location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } # Deny access to htaccess and htpasswd files location ~ /\.ht { deny all; } } </code></pre> <p>I have included this files directory in nginx.conf "include /etc/nginx/v-hosts/*.conf;" but for some reason it's not loading it and won't point the server_name to /srv/www/ ? </p> <p>Does anyone have any suggestions as to why it won't load additional server.conf ? </p> <p>I can drag the wordpress install into /usr/share/nginx/html and it works but then I can't have any more than one server. I think it's something to do with my nginx.conf but not sure what to change / add? </p> <p>Regards Crafty</p> </div>

wordpress安装不能访问install.php............

一点击install.php就是一个404页面咋办啊,是访问的东西错了还是咋回事

dockerfile编写mysql镜像,docker-compose构建启动

宿主机Centos系统 docker容器Centos系统 ![图片说明](https://img-ask.csdn.net/upload/201911/22/1574394091_21015.png) 输入指令报错找不到libncurses.so.5 ![图片说明](https://img-ask.csdn.net/upload/201911/22/1574394269_239321.png) 按照网上的解决方法,已经通过yum install libncurses.so.5安装了,仍然报错一样 ![图片说明](https://img-ask.csdn.net/upload/201911/22/1574394480_976142.png) 上图明明可以找到呀,怎么办呢? 建立软连接后ln -s libtinfo.so.5.9 libtinfo.so.5 又出现了新的问题 ![图片说明](https://img-ask.csdn.net/upload/201911/22/1574405708_431570.png)

为什么我的php没有呈现? 为什么我的php页面空白?

<div class="post-text" itemprop="text"> <p>I'm trying to setup a wordpress server, but before that I need to get PHP working. Currently I have installed and configured nginx and php 7.3, but the php is not rendering, it is just showing text.</p> <p><strong>Main Issue:</strong> </p> <pre><code>[root@a-knapsack-sav ~]# cat /usr/share/nginx/html/info.php &lt;?php phpinfo(); ?&gt; [root@a-knapsack-sav ~]# curl http://localhost/info.php &lt;?php phpinfo(); ?&gt; </code></pre> <p>Obviously I should expect to see some content from the above, but I'm not. The following is all of the setup that I've done. Hopefully someone can see this and point out my likely omission.</p> <p><strong>What OS are you using?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# rpm -q centos-release centos-release-7-6.1810.2.el7.centos.x86_64 </code></pre> <p><strong>Is nginx even installed?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# nginx -v nginx version: nginx/1.15.12 </code></pre> <p><strong>Is php even installed?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# php -v PHP 7.3.5 (cli) (built: Apr 30 2019 08:37:17) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.5, Copyright (c) 1999-2018, by Zend Technologies </code></pre> <p><strong>Where is nginx installed?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# pwd /etc/nginx [root@a-knapsack-sav nginx]# ls conf.d fastcgi_params koi-utf koi-win mime.types modules nginx.conf scgi_params sites-available sites-enabled uwsgi_params win-utf </code></pre> <p><strong>Is php-fpm even running?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# systemctl status php-fpm ● php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2019-05-03 10:42:25 CDT; 7h ago Main PID: 2772 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/php-fpm.service ├─2772 php-fpm: master process (/etc/php-fpm.conf) ├─2773 php-fpm: pool www ├─2774 php-fpm: pool www ├─2775 php-fpm: pool www ├─2776 php-fpm: pool www └─2777 php-fpm: pool www </code></pre> <p><strong>Is nginx even running?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# systemctl status nginx ● nginx.service - nginx - high performance web server Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2019-05-03 17:19:55 CDT; 31min ago Docs: http://nginx.org/en/docs/ Process: 4299 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS) Process: 4302 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS) Main PID: 4303 (nginx) CGroup: /system.slice/nginx.service ├─4303 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf └─4304 nginx: worker process </code></pre> <p><strong>Did you edit you php.ini?</strong> Only the <code>cgi.fix_pathinfo</code> for security.</p> <pre><code>[root@a-knapsack-sav nginx]# cat /etc/php.ini | grep cgi.fix ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; http://php.net/cgi.fix-pathinfo cgi.fix_pathinfo=0 </code></pre> <p><strong>Did you update php's conf settings to for nginx?</strong><br> I think so.</p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/php-fpm.d/www.conf | grep listen ; - 'listen' (unixsocket) ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; 'port' - to listen on a TCP socket to all addresses ; '/path/to/unix/socket' - to listen on a unix socket. listen = /var/run/php-fpm/php-fpm.sock ; Set listen(2) backlog. ;listen.backlog = 511 listen.owner = nobody listen.group = nobody ;listen.mode = 0660 ; When set, listen.owner and listen.group are ignored ;listen.acl_users = apache,nginx ;listen.acl_groups = ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address listen.allowed_clients = 127.0.0.1 ; listen queue - the number of request in the queue of pending ; connections (see backlog in listen(2)); ; max listen queue - the maximum number of requests in the queue ; listen queue len - the size of the socket queue of pending connections; ; listen queue: 0 ; max listen queue: 1 ; listen queue len: 42 [root@a-knapsack-sav ~]# cat /etc/php-fpm.d/www.conf | grep nginx user = nginx group = nginx ;listen.acl_users = apache,nginx </code></pre> <p><strong>Did you update nginx's conf properly?</strong> As far as I know to....</p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/nginx/conf.d/default.conf server { listen 80; # listen [::]:80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~* \.php$ { try_files $uri =404; fastcgi_index index.php; include fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param SCRIPT_NAME $fastcgi_script_name; } # location ~ /.ht { # deny all; # } } </code></pre> <p><strong>Do you have your info.php file in the correct place?</strong><br> Yezzir.</p> <pre><code>[root@a-knapsack-sav ~]# ls /usr/share/nginx/html 50x.html index.html info.php </code></pre> <p><strong>What about your nginx.conf?</strong></p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/nginx/nginx.conf user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*.conf; server_names_hash_bucket_size 64; } </code></pre> <p><strong>What about your sites-available conf?</strong> I don't know if this is needed but I tried it anways.</p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/nginx/sites-available/default.conf server { listen 80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ .php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # location ~ /.ht { # deny all; # } } </code></pre> <p><strong>Did you forget to link sites-enabled and sites-available?</strong> Nope :)</p> <pre><code>[root@a-knapsack-sav ~]# ls -lrt /etc/nginx/sites-enabled total 0 lrwxrwxrwx. 1 root root 39 May 3 12:40 default.conf -&gt; /etc/nginx/sites-available/default.conf </code></pre> <p>I hope this is everything. I think this is everything I've done. The index.html loads when I <code>curl http://localhost</code> but as shown above the info.php is not rendered when called. I think, I've set this up almost correct, but I'm pretty sure I missed something. Please let me know if something seems off. I tried to follow <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7</a> (mysql is on another server). Also if there is any configuration that I need to change so that <code>curl http://A.B.C.D</code> doesn't hang and returns like <code>curl http://localhost</code>, I'd appreciate it. Thanks :)</p> <p>Edit:</p> <p><strong>What is your entire config?</strong></p> <pre><code>[root@a-knapsack-sav ~]# nginx -T nginx: [warn] conflicting server name "A.B.C.D" on 0.0.0.0:80, ignored nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful # configuration file /etc/nginx/nginx.conf: user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*.conf; server_names_hash_bucket_size 64; } # configuration file /etc/nginx/mime.types: types { text/html html htm shtml; text/css css; text/xml xml; image/gif gif; image/jpeg jpeg jpg; application/javascript js; application/atom+xml atom; application/rss+xml rss; text/mathml mml; text/plain txt; text/vnd.sun.j2me.app-descriptor jad; text/vnd.wap.wml wml; text/x-component htc; image/png png; image/svg+xml svg svgz; image/tiff tif tiff; image/vnd.wap.wbmp wbmp; image/webp webp; image/x-icon ico; image/x-jng jng; image/x-ms-bmp bmp; font/woff woff; font/woff2 woff2; application/java-archive jar war ear; application/json json; application/mac-binhex40 hqx; application/msword doc; application/pdf pdf; application/postscript ps eps ai; application/rtf rtf; application/vnd.apple.mpegurl m3u8; application/vnd.google-earth.kml+xml kml; application/vnd.google-earth.kmz kmz; application/vnd.ms-excel xls; application/vnd.ms-fontobject eot; application/vnd.ms-powerpoint ppt; application/vnd.oasis.opendocument.graphics odg; application/vnd.oasis.opendocument.presentation odp; application/vnd.oasis.opendocument.spreadsheet ods; application/vnd.oasis.opendocument.text odt; application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; application/vnd.wap.wmlc wmlc; application/x-7z-compressed 7z; application/x-cocoa cco; application/x-java-archive-diff jardiff; application/x-java-jnlp-file jnlp; application/x-makeself run; application/x-perl pl pm; application/x-pilot prc pdb; application/x-rar-compressed rar; application/x-redhat-package-manager rpm; application/x-sea sea; application/x-shockwave-flash swf; application/x-stuffit sit; application/x-tcl tcl tk; application/x-x509-ca-cert der pem crt; application/x-xpinstall xpi; application/xhtml+xml xhtml; application/xspf+xml xspf; application/zip zip; application/octet-stream bin exe dll; application/octet-stream deb; application/octet-stream dmg; application/octet-stream iso img; application/octet-stream msi msp msm; audio/midi mid midi kar; audio/mpeg mp3; audio/ogg ogg; audio/x-m4a m4a; audio/x-realaudio ra; video/3gpp 3gpp 3gp; video/mp2t ts; video/mp4 mp4; video/mpeg mpeg mpg; video/quicktime mov; video/webm webm; video/x-flv flv; video/x-m4v m4v; video/x-mng mng; video/x-ms-asf asx asf; video/x-ms-wmv wmv; video/x-msvideo avi; } # configuration file /etc/nginx/conf.d/default.conf: server { listen 80; # listen [::]:80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~* \.php$ { try_files $uri =404; fastcgi_index index.php; include fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param SCRIPT_NAME $fastcgi_script_name; } # location ~ /.ht { # deny all; # } } # configuration file /etc/nginx/fastcgi_params: fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REQUEST_SCHEME $scheme; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; # configuration file /etc/nginx/conf.d/default_original.conf: server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # configuration file /etc/nginx/sites-enabled/default.conf: server { listen 80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ .php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # location ~ /.ht { # deny all; # } } </code></pre> </div>

LNMP搭建后wordpress无法正常显示界面

![图片说明](https://img-ask.csdn.net/upload/202004/10/1586483179_828695.png) 如图所以,登录后,界面显示无背景,只有文字

nginx+php larvel+querylist放在512MB内存vps响应速度慢

nginx+php larvel+querylist放在512MB内存vps响应速度慢,之前换过1G内存的vps也是一样的 我搭建的是一个影视网站,数据一般不从数据库取,一般都是采集的别的网站的图片和链接,但是没有保存到数据库,访问集数多(大于40集)的页面需要15秒,不知道这是什么原因?然后我还搭建了wordpress,访问很快,而且访问影视网的主页很快,就是访问集数多的很慢,我不知道是php+nginx没有优化好,还是什么原因,可能是请求数太多了导致很慢,大家有什么优化的方式吗? 演示网址:http://tv.memorygzs.com/play/aHR0cHM6Ly93d3cuMzYwa2FuLmNvbS90di9STEZzY0g3bFJtVHROMy5odG1s.html### ![图片说明](https://img-ask.csdn.net/upload/201911/01/1572574056_658755.png)

欢迎来到Dgininx的Nginx

<div class="post-text" itemprop="text"> <p>I have a VPS with CentOS and DirectAdmin installed. This VPS only have one site with WordPress CMS but Apache have very usage of 1 GB Ram. for this i buy license and install Danginx plugin.after installing dangnix, my site and IP only show "Welcome to Nginx" text and every other files show 404 error page. after many Google searchs, everyone says install new ioncube loader but i installed this before Dangnix installation and more than 2 time reinstall. php -v command also show ioncube loader has installed but my site still show Welcome text. when i restart apache with service httpd restart command show this error :</p> <p>NameVirtualHost 79.127.127.143:8888 has no VirtualHosts (98)Address already in use: make_sock: could not bind to address [::]:80 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs</p> <p>after many edits now this command show only "NameVirtualHost 79.127.127.143:8888 has no VirtualHosts" error.</p> <p>Sorry for my bad english. Thanks.</p> </div>

在Docker或物理主机上托管WordPress

<div class="post-text" itemprop="text"> <p>I am planning to create a shared WordPress hosting system for clients. </p> <p>The needed services are : PHP, MySQL/MariaDB, SFTP, (Nginx/Apache : which one is better and faster and more secure ? )</p> <ul> <li>If i am going to use Docker then the applications are going to be mounted on a volume on the Docker host the container will include the PHP files.</li> <li>If on a physical CentOS or Ubuntu host then all the websites will share the same PHP files.</li> </ul> <p>The Nginx/Apache will be one for all the websites, and one database engine to serve them all.</p> <p>Have anyone done such scenario? what do you suggest, what are the advantages and disadvantages in both cases. </p> </div>

4个wordpress域,2个工作但2个映射给出错误并且没有正确加载

<div class="post-text" itemprop="text"> <p>i have 4 domains to be use like this in wordpress:</p> <pre><code> !-domain1.org (primary site in network) ! network !-domain2.com (setup as subdomain of domain1 then changed to be a domain) ! -domain3.com (it will show domain2.com but in spanish with polylang ! -domain4.com (it will show domain2.com but in portuguese with polylang </code></pre> <p>domain1 and domain2 load perfect in browser</p> <p>but i cant make domain2 and domain3 to work</p> <p>i use nginx and apache trought a tcp .sock on centos6</p> <p>i have Mu domain mapping installed but in domain mapping what should i put my ip, domain1.org or domain2.com ??</p> <p>and in nginx what needs to be done to point the domain3 and domain4 correctly to not get the no file found or 502 errors</p> <p>i know this might be a noob question but i have been stuck for 2 days please help</p> </div>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

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

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

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

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

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

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

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

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

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

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

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

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

面试:第十六章:Java中级开发

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

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

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

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

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐