I have an existing PHP site located on /var/www/A
, now I want to add a blog module on /var/www/A/wordpress
. I have installed wordpress below /var/www/A successfully
. I can visit it via
http://localhost/mysite.com/www/wordpress
Now What I will to do next is : when a user regist on my site, at the same time create a new user in wordpress, so I need to invoke wordpress's API, and I found one wp_insert_user
.
I have a User.php and have a login function and I'll wp_insert_user
code into it.
Fisrt, import API, I added these two lines on the head of my User.php
define('WP_USE_THEMES', false);
require('/var/www/A/wordpress/wp-blog-header.php');
Second, visit my site via browser. Befor I include two lines, I can via below url to visit logon my site.
http://localhost/mysite.com/www/logon.php
But, after I added two lines, when I visit my site via
http://localhost/mysite.com/www/logon.php
it has been redirect or changed to
http://localhost/mysite.com/www/logon.php/wp-admin/install.php
I notice that I have wp-admin/install.php
on my url, but I have installed it before below my project /var/www/A/wordpress
, I can visit it via
http://localhost/mysite.com/www/wordpress
What a worese, all the style of my logon.php are completely different.
What should I do next ? Thanks in advance.