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
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
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.
But, after I added two lines, when I visit my site via
it has been redirect or changed to
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
What a worese, all the style of my logon.php are completely different.
What should I do next ? Thanks in advance.