New issue

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

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

Already on GitHub? Sign in to your account

When open http://myYOURLS.com/admin , it shows HTTP ERROR 500. #2288

Closed
mashirozx opened this Issue Sep 6, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@mashirozx

mashirozx commented Sep 6, 2017

Before my submission:

Technical details regarding my environment

  • YOURLS version: I don't know the version, but I just clone it via https://github.com/YOURLS/YOURLS.git TODAY (Sep. 7th, 2017)
  • PHP version: PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
  • Any other useful information depending on context (server OS & version, MySQL version, browser version, …):
    Ubuntu 16.04;
    Nginx 1.10.3;
    mysql Ver 14.14 Distrib 5.7.19.

Reproducible bug summary

When open http://myYOURLS.com/admin , it shows HTTP ERROR 500.

Checked Nginx error log:

2017/09/07 00:28:18 [error] 30718#30718: *202 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'yourls.yourls_options' doesn't exist in /var/www/myYOURLS.com/public_html/includes/vendor/aura/sql/src/ExtendedPdo.php:748
Stack trace:
#0 /var/www/myYOURLS.com/public_html/includes/vendor/aura/sql/src/ExtendedPdo.php(748): PDOStatement->execute()
#1 /var/www/myYOURLS.com/public_html/includes/vendor/aura/sql/src/ExtendedPdo.php(569): Aura\Sql\ExtendedPdo->perform('SELECT option_n...', Array)
#2 /var/www/myYOURLS.com/public_html/includes/YOURLS/Database/Options.php(46): Aura\Sql\ExtendedPdo->fetchPairs('SELECT option_n...')
#3 /var/www/myYOURLS.com/public_html/includes/functions.php(1097): YOURLS\Database\Options->get_all_options()
#4 /var/www/myYOURLS.com/public_html/includes/load-yourls.php(169): yourls_get_all_options()
#5 /var/www/myYOURLS.com/public_html/admin/index.php(3): require_once('/var/www/myYOUR...')
#6 {main}
  thrown in /var/www/myYOURLS.com/public_html/includes/vendor/aura/sql/sr" while reading response header from upstream, client: 61.159.236.159, server: u.shino.cc, request: "GET /admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "u.shino.cc"

Sorry, I'm new to php and nginx, maybe not a bug, I'd be very grateful if you can help me.

@mashirozx

This comment has been minimized.

Show comment
Hide comment
@mashirozx

mashirozx Sep 6, 2017

Also, my nginx default:

server {
	listen 443 ssl;
	listen [::]:443 ssl;
	server_name u.shino.cc;
	
	ssl on;
        ssl_certificate /etc/letsencrypt/live/u.shino.cc/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/u.shino.cc/privkey.pem;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;

	root /var/www/myYOURLS.com/public_html;

	access_log /var/www/myYOURLS.com/logs/access.log;
	error_log /var/www/myYOURLS.com/logs/error.log;

	index index.php;

	location / {
	    try_files $uri $uri/ /yourls-loader.php;
	    expires 14d;
	    add_header Cache-Control 'public';
	}

	location ~ \.php$ {
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        	fastcgi_index index.php;
        	include fastcgi_params;
        	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        	fastcgi_intercept_errors off;
        	fastcgi_buffer_size 16k;
        	fastcgi_buffers 4 16k;
	}
}

PS. In the same VPS, my WordPress blog works fine.

mashirozx commented Sep 6, 2017

Also, my nginx default:

server {
	listen 443 ssl;
	listen [::]:443 ssl;
	server_name u.shino.cc;
	
	ssl on;
        ssl_certificate /etc/letsencrypt/live/u.shino.cc/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/u.shino.cc/privkey.pem;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;

	root /var/www/myYOURLS.com/public_html;

	access_log /var/www/myYOURLS.com/logs/access.log;
	error_log /var/www/myYOURLS.com/logs/error.log;

	index index.php;

	location / {
	    try_files $uri $uri/ /yourls-loader.php;
	    expires 14d;
	    add_header Cache-Control 'public';
	}

	location ~ \.php$ {
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        	fastcgi_index index.php;
        	include fastcgi_params;
        	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        	fastcgi_intercept_errors off;
        	fastcgi_buffer_size 16k;
        	fastcgi_buffers 4 16k;
	}
}

PS. In the same VPS, my WordPress blog works fine.

@dgw

This comment has been minimized.

Show comment
Hide comment
@dgw

dgw Sep 6, 2017

Collaborator

Sounds misconfigured. Verify the YOURLS_DB_NAME and YOURLS_DB_PREFIX settings in user/config.php.

Collaborator

dgw commented Sep 6, 2017

Sounds misconfigured. Verify the YOURLS_DB_NAME and YOURLS_DB_PREFIX settings in user/config.php.

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Sep 6, 2017

Member

Can reproduce. Indeed there's something not working as expected. Looking into it !

Member

ozh commented Sep 6, 2017

Can reproduce. Indeed there's something not working as expected. Looking into it !

@ozh ozh closed this in ff10450 Sep 6, 2017

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Sep 6, 2017

Member

@mashirozx Hopefully this is fixed.

You can update your YOURLS setup (git pull in the command line or your Git tool, or download all the files and overwrite) and test again -- please report the results.

Member

ozh commented Sep 6, 2017

@mashirozx Hopefully this is fixed.

You can update your YOURLS setup (git pull in the command line or your Git tool, or download all the files and overwrite) and test again -- please report the results.

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Sep 6, 2017

Member

(@mashirozx Just adding that there are numerous issues closed and some still open about nginx -- any subsequent problem may or may not be related to this issue reported here that I hopefully fixed in my latest commit)

Member

ozh commented Sep 6, 2017

(@mashirozx Just adding that there are numerous issues closed and some still open about nginx -- any subsequent problem may or may not be related to this issue reported here that I hopefully fixed in my latest commit)

@mashirozx

This comment has been minimized.

Show comment
Hide comment
@mashirozx

mashirozx Sep 7, 2017

@ozh Thanks, following your guidance I've installed successfully. But I meet another issue: when open https://domain.com/shortdomain, it's 404 Not Found, I have created a .htaccess following admin/install.php guidance, but I'm Nginx, to be honest, I don't think Nginx needs a .htaccess file.
For I'm new to Nginx, it takes me some time to solve this problem, so my suggestion is to remove the progress of creating .htaccess file when the installation is on a None-Apache server.

mashirozx commented Sep 7, 2017

@ozh Thanks, following your guidance I've installed successfully. But I meet another issue: when open https://domain.com/shortdomain, it's 404 Not Found, I have created a .htaccess following admin/install.php guidance, but I'm Nginx, to be honest, I don't think Nginx needs a .htaccess file.
For I'm new to Nginx, it takes me some time to solve this problem, so my suggestion is to remove the progress of creating .htaccess file when the installation is on a None-Apache server.

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Sep 7, 2017

Member

Indeed, nginx doesn't need an .htaccess. Everything you need to know is in the wiki, and this in particular: https://github.com/YOURLS/YOURLS/wiki/Nginx-configuration

Member

ozh commented Sep 7, 2017

Indeed, nginx doesn't need an .htaccess. Everything you need to know is in the wiki, and this in particular: https://github.com/YOURLS/YOURLS/wiki/Nginx-configuration

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Sep 7, 2017

Member

@mashirozx I overlooked your comment -- yes, you're right, it's probably useless to create a .htaccess file when running on nginx, but I suspect there might be tricky situations since Apache and nginx can be run together (ie using nginx as a a proxy in front of Apache). Not an nginx user myself, so I'd rather create a useless file than run into another edge case :)

Member

ozh commented Sep 7, 2017

@mashirozx I overlooked your comment -- yes, you're right, it's probably useless to create a .htaccess file when running on nginx, but I suspect there might be tricky situations since Apache and nginx can be run together (ie using nginx as a a proxy in front of Apache). Not an nginx user myself, so I'd rather create a useless file than run into another edge case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment