I know there are a lot of posts about this, but most of them seem to be much later on in the life of a wordpress site - mine is happening on the install.php, so I'm guessing its a more fundamenal issue.
My setup:
Windows 10 (1803)
Nginx (1.15.2)
PHP (7.2.9 - None Thread Safe)
MySQL (8.0 - Community)
The file structure - (in case it has any baring is)
nginx - \Development\nginx\nginx-1.15.2\
PHP - \Development\php\php-7.2.9-nts-Win32-VC15-x64\
nginx is serving files from its /html/ directory, with wordpressin a sub-directory html/wordpress
MySQL has a blank database called "wordpress" created, and is accessible via the command line, and the HeidiSQL application using the credentials for the wordpress site.
I know that php is working as a basic <?php phpinfo(); ?> file outputs the PHP info, and accessing http://127.0.0.1:8080/wordpress/wp-admin/setup-config.php starts the install proces with the screen requesting database info. However submitting this goes to:
http://127.0.0.1:8080/wordpress/wp-admin/setup-config.php?step=2
Which throws the 500 error, blank white screen.
In the nginx access log I can see this:
127.0.0.1 - - [28/Aug/2018:08:56:20 +0100] "POST /wordpress/wp-admin/setup-config.php?step=2 HTTP/1.1" 500 5 "http://127.0.0.1:8080/wordpress/wp-admin/setup-config.php?step=1&language=en_GB" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"
But there is nothing in the nginx error log - literally nothing, it was filled with missing favicon lines but i created a blank one to reduce the noise from that.
When wp-config.php is hard coded with the database info and the line define('WP_DEBUG', true);, accessing install.php gives the error 500 error - but no additional information.
Any idea what the issue is?
Could it be a file permissions issue, I'm assuming nginx is running as my windows user - which is an administrator.
UPDATE:
Windows php doesn't come with an php.ini file (why!!!) so I crabbed one from http://www.reallylinux.com/docs/php.ini and placed it int eh php root directory - this worked and i could switch on erro logging
This now gives me somethign to work on - as I'e got to the route of the issue:
[error] 2200#6728: *9 FastCGI sent in stderr: "PHP Fatal error:
UncaughtError: Call to undefined function mysql_connect() in \nginx\nginx-1.15.2\html\wordpress\wp-includes\wp-db.php:1564
Any one know why mysql_connect() is undefined?
UPDATE 2:
The actual route cause of the issue was this PHP bug:
Cannot connect to mysql 8 using Php 7.2.8 (https://bugs.php.net/bug.php?id=76660)
Downgrading to PHP 7.2.7 and the issue went away... given the changes made in the accepted answer.
mysql_connect() is a function that was there till PHP 5.2, and was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. Ref: PHP Manual
Related
I have a problem with opencarted payment modules. I use version 3.0.0.0 and all modules are working fine except the ones that are in payment section. I get an Internal Server Error which at logs says:
GET /admin/index.php?route=extension/extension/payment&user_token=LpWyMlFDTymqDs4I6Q1iUwUV6sI3VCet HTTP/1.0 http://eshop.capsport.gr/admin/index.php?route=marketplace/extension&user_token=LpWyMlFDTymqDs4I6Q1iUwUV6sI3VCet Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 303 Apache access
2017-07-12 10:27:38 Warning 94.70.255.140 mod_fcgid: stderr: PHP Fatal error: Can't use method return value in write context in /var/www/vhosts/paokbcstore.gr/eshop.capsport.gr/admin/controller/extension/payment/pp_express.php on line 1282, referer: http://eshop.capsport.gr/admin/index.php?route=marketplace/extension&user_token=LpWyMlFDTymqDs4I6Q1iUwUV6sI3VCet Apache error
2017-07-12 10:28:34 Warning RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
Any possible solutions?
I am using openCart v. 3.0.1.0
and Plesk for web hosting
I was having a similar 500 internal server error when I proccessing the checkout step 6.
My mistake was that, I was imported from an old version of openCart the data of the old Database to the new one.. But, in this senario the new version of openCart has some new table's columns as a saw carefully (such as inside table oc_order: tracking, payment_custom_field and so on). So, I have created these colums again, and now the step 6 from the checkout finally works again..
Iniside Plesk there is a choice saying: error-logs (or you can find it something like: log file, logs files e.t.c.). Inside this file I saw the mistake that says:
"mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'Exception' with message 'Error: Unknown column 'tracking' in 'field list'" that's how I found the issue to my problem..
there are lots of things you could try though:
You could try some of the above...maybe could help you:
clear all caches
disable all extensions and inable them one by one, in order to see which one of them causes the problem..
download the same openCart version that you are using, and upload the checkout core files again.. maybe some of those files broke you code..(although this problem coming from extensions - modules)
check PHP version. Some users in openCart forum said that the problem solved by using the version of PHP 7.
see pp_express what are the needs of this payment proccess (link to github that my help you or maybe ask there: https://github.com/opencart/opencart/blob/master/upload/catalog/controller/extension/payment/pp_express.php)
I am seeing a 500 error when running cmsms-2.1.6-install.php
What I have tried so far:
Checked error logs. They show the 500 error on the hit. The description is simlply "-"
Verified PHP at required version (5.6)
Tried previous version of CMSMS (2.1.5)
CHMOD installers - 777
Uploaded a PHPINFO and ran it - Returned as expected. Used this to verify PHAR enabled
Hosting is running PHP on Linux.
Verified its not the .htaccess file by deleting it - Still throws 500 Server Error
Any ideas/suggestions appreciated.
Thanks.
I have now solved this. The CMS Made Simple installation PHP file needs to be uploaded in FTP Binary mode as it contains compressed sections.
I've used this tutorial to set up a simple webserver on Amazon EC2, with PHP, mySQL, nginx and php-fpm. Everything seems to be up and running, html pages are opening just fine. My phpinfo() works fine as well, showing Server API as FPM/FastCGI and php-fpm as active. So far so good.
I now copied one of my old websites, which uses php and is working fine on my old server (which runs Apache without php-fpm by the way), to the new server and opened the index.php page. It opens, displays fine, but the Twitter login button to continue into the application shows this link:
<? echo $content;?>
Instead of showing "redirect.php" as it does on the live website. So somehow it seems as if the php within the page is not working. With a clean nginx error.log, reloading this page generates the following output in the log:
2016/10/29 12:32:58 [error] 2936#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning: session_start(): open(/var/lib/php/session/sess_45g3uvcilj8913naoa1nrenfn3, O_RDWR) failed: Permission denied (13) in /var/www/html/*****/index.php on line 2
PHP message: PHP Notice: A session had already been started - ignoring session_start() in /var/www/html/*****/index.php on line 6
PHP message: PHP Notice: Undefined index: access_token in /var/www/html/*****/index.php on line 15" while reading response header from upstream, client: *****, server: *****, request: "GET /tlm/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "*****"
I'm guessing that the permission denied error may be the cause, but I'm having a hard time figuring out why. Especially since the phpinfo() file works just fine. As you can probably tell, I'm a novice when it comes to these things.
Something about my config: the user in nginx.conf is set to nginx, and /etc/php-fpm.d/www.conf contains at least the following:
listen = /var/run/php-fpm/php-fpm.sock
listen.allowed_clients = 127.0.0.1
listen.owner = nginx
listen.group = nginx
listen.mode = 0664
user = nginx
group = nginx
So, I'm not even really sure I have a question that's more specific than "Why doesn't this page work?" But I hope that someone is able to help anyway.
I've seen plenty of similar questions, sometimes not having an +x on some of the folders leading up to the webserver content being the problem, but I've verified and world has +x on every folder leading up to my webserver folder so that shouldn't be the problem.
Anyone who might be able to point me in the right direction? Thanks in advance for your patience :)
It seems your new installation of php does not allow the short tag http://php.net/manual/en/ini.core.php#ini.short-open-tag
Maybe I should ask this question in the Ubuntu section instead, but don't really know where the problem is so I'm trying here first.
I'm trying to learn how to use SQL database through a webserver, and I've used this tutorial: Link
I've done everything like in the tutorial, but I'm using Ubuntu server, not windows.
The problem is that the app is not able to display or create any entries from/in the database. I use PHPMyAdmin to manage the SQL database.
1. So my main question: Is there any difference between WAMP/LAMP? Or can I use the same approach?
If the answer is YES, then I have some more questions:
I'm using the default location for my server /var/www/ and have put all the .php files there? Correct?
When he makes the db_config.php he uses "localhost" but I want to use my ip instead, do I just have to change "localhost" to "81.xxx.xxx.xxx" or do I need to add something more?
As you can see I'm not really sure where the problem is, if it's the compability between the tutorial and the LAMP server instead of WAMP, or if it's the config of the connection, something in the php codes, the placement of the php files or whatever?
It's so frustrating because I don't know where to start.
Thank you in advance!
EDIT:
I can access the php files on the server so no problem there.
This is from my access.log file when trying to list all items: [09/Oct/2013:16:56:07 +0200] "GET /var/www/get_all_products.php? HTTP/1.1" 404 450 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)"
This is when I try to create a new product: [09/Oct/2013:19:26:14 +0200] "POST /var/www/create_product.php HTTP/1.1" 404 448 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)"
And this if from the error.log file when trying to list all items: [Wed Oct 09 17:01:51 2013] [error] [client 81.225.106.145] File does not exist: /var/www/var
I get the same error when trying to create a new product.
Can you guys make anything out of this??
Is there any difference between WAMP/LAMP? Or can I use the same approach?
Yes, there are differences - mostly related to networking and security. However, there's no reason the code in that tutorial wouldn't work Ubuntu.
Firstly, are you running both the web server and database on the same Ubuntu machine? If so, you can leave the "localhost" entry - you need to specify an IP address if the web server and database are on different machines. If everything's on the same server, that just complicates matters, and breaks when your IP address changes. You should certainly not use a public IP address (like 81...*), because then your traffic from the web server may well get routed out on the internet to reach your database.
Secondly, if PHPMyAdmin is running on the same server as your web app, there's no problem connecting from your web server to the database in principle.
Thirdly, have you tried accessing the URLs in a browser to see if they are working? If that doesn't work, the app can't won't be able to access them either. The tutorial mentions http://api.androidhive.info/android_connect/get_all_products.php - presumably you've changed that to http://IPAddressOfUbuntuServer/android_connect/get_all_products.php. First see if you can access that URL (to get it to go, you should put your files in /var/www/android_connect) via a browser, and work out what's going on. Once that works, try accessing that in the browser on the Android device; if that works, the app should too.
I just moved my codeigniter app from one machine to another.
I’m getting the above error message.
here’s what I’ve checked so far:
config.php for code igniter has the following:
$config[‘base_url’] = ‘http://myserver/myapp/’;
when i navigate to
http://myserver/myapp/index.php
i don,‘t get any error messages, and nothing is displayed /rendered. I do a view source and there is no html on the page. (btw. I have specified “welcome” as my default controller in routes). when i navigate to:
http://myserver/myapp/index.php/welcome
it's the same result.
I checked my apache2 access log this is what it contains:
127.0.0.1 - - [14/Aug/2012:13:27:37 -0400] "GET /myapp/index.php/welcome HTTP/1.1" 200 293 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1"
127.0.0.1 - - [14/Aug/2012:13:27:48 -0400] "GET /myapp/index.php/switches HTTP/1.1" 200 293 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1"
shouldn’t it have
“GET http://myserver/myapp/index.php/welcome”
instead of just
“myapp/welcome”?
also i tried looking up the apache error message # 293 but i haven't come across anything that is helpful for troubleshooting.
The thing is other applications work. So i can do
“http://myserver/phpmyadmin”
and it works.
Also i created a test.php page in my “myapp” folder and it works too.
I’m not using .htaccess as far as i can tell. I have the following variables set in my config.php for codeigniter:
$config[‘index_page’] = ‘index.php’;
$config[‘uri_protocol’] = ‘AUTO’;
Error logging is turned on both in the php.ini file and also in the code igniter config file.
You have the "white screen of death". work backwards - install a "clean" version of Codeigniter and see if that works - then slowly move forward from there.
Then what you do is 'slowly' transition your site across. i.e. start with your site config - move it to the 'new' site. then change your main controller, then your db etc etc - until the error shows itself.
Could it be because you are using curly quotes rather than the regular ones?
$config[‘base_url’] = ‘http://myserver/myapp/’;
is different than
$config['base_url'] = 'http://myserver/myapp/';
The problem was the autoload.php contained the helper class 'url'. On the new machine, this item was not set. Its unclear why this file was the only one not copied over.. or overwritten properly. In any case, CI was dying on my pages because i make calls to base_url(). It's still unclear why the error messages have not been displayed.
For now, the app is back up and running. I am still trying to figure out why PHP errors are not displayed but i will doulbe check everything first before posting back.
Thanks all.
I had an issue on moving server where php short tags <?= ?> were not enabled in php.ini
this meant I was getting a blank page and this in the html source (output by layout->render_page):
<?= $header; ?>
<?= $contents; ?>
<?= $footer; ?>
Enabling them in php.ini short_open_tag = On fixed my issue.