David, not sure you received my email(s) about needing help then retracting after doing a reinstall.
Well, I reinstalled the scripts using the the latest version. I dropped all the tables and then ran setup.php. When I reinstalled I just overwrote the files, except a few that I had to modify like the htaccess file and some of the config data I copied from the old config, the new config has the added "related" products part.
I am able to import some feeds via the admin area. I can do test imports on all files, no errors.
When I try to run import.php @ALL via a .sh page as a cron job I get this error
X-Powered-By: PHP/4.4.3
Content-type: text/html
Warning: main(includes/javascript.php) [function.main]: failed to open stream: No such file or directory in /home/xxx/public_html/includes/common.php on line 16
Warning: main(includes/javascript.php) [function.main]: failed to open stream: No such file or directory in /home/xxx/public_html/includes/common.php on line 16
Fatal error: main() [function.require]: Failed opening required 'includes/javascript.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxx/public_html/includes/common.php on line 16
For those feeds I imported using the admin control panel, they import just fine. I imported 17,000+ products.
The search works fine, product pages too.
But I do get this error on a page I use the search script to populate the page with:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/includes/database.php on line 21
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/includes/database.php on line 26
If I'm doing a clean install, what is the best process? (I'm thinking a clean install migh be the best way to solve my problem.)
Any advice would be appreciated.
I figured out the code on the custom pages. Thanks!
I logged in via SSH and when I tried CD then the import file, cd /home/xxx/public_html/scripts/
php import.php @ALL
I received
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/includes/database.php on line 18
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/includes/database.php on line 22
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/includes/database.php on line 27
backfilling reviews/home/dflsport/public_html.
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/includes/database.php on line 44
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/includes/database.php on line 18
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/includes/database.php on line 22
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/includes/database.php on line 27
Thanks!
Hi Don,
This implies that MySQL is not working correctly when running on the command line. The libraries are definitely compiled in (otherwise you would get an undefined function error) so it could be a permissions problem.
Could you try a test script with the following code in your /scripts/ directory...
test.php
<?php
$link = mysql_connect("localhost","username","password")
or die("Database Error: " . mysql_error());
print "<p>MySQL Version ".mysql_get_server_info($link)."</p>";
?>
Replace username and password with the same values that you have configured in config.php, and then do the same as before - cd into the /scripts directory and
php test.php
The MySQL error message which should be displayed will give more information about the problem - so if you could post the output from this script that will help work out what's going on.
Cheers,
David.
I see this:
MySQL Version 4.1.21-standard
I'll add this tidbit, when my site was running very slow, I emailed support and they sent this
I have checked the server and found there are many sleeping mysql process in the server. Please make sure the scripts that are using the database are closing the tables properly otherwise those process wil got to sleeping state consuiming memory and cpu. I have turned off the mysql.allow_persistent in php.ini to reduce this
Not sure if that may have caused a problem
After that I reinstalled the script and all is well except trying to run the import.php @ALL
Hi Don,
That's interesting - I don't really understand what is preventing it from accessing the database. Can you try this:
<?php
require("../includes/common.php");
$link = mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword)
or die("Database Error: " . mysql_error());
print "<p>MySQL Version ".mysql_get_server_info($link)."</p>";
?>
That should replicate the conditions in import.php. The allow persistent connections should cause any problem.
Cheers,
David.
This is the output:
Warning: mysql_connect(): Access denied for user 'xxx'@'localhost' (using password: NO) in /home/dflsport/public_html/scripts/test.php on line 3
I substituted xx for my username
Hi Don,
That's interesting - so it worked when you entered your username and password directly, but not when it used the versions from your config.php file.
Next thing to do is to modify the script to print them and see if you can see a difference between what you think they should be and what is being used:
<?php
require("../includes/common.php");
print "Using database server: ".$config_databaseServer."\n";
print "Using database username: ".$config_databaseUsername."\n";
print "Using database password: ".$config_databasePassword."\n";
$link = mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword)
or die("Database Error: " . mysql_error());
print "<p>MySQL Version ".mysql_get_server_info($link)."</p>";
?>
Do the server, username and password look correct when you run this script?
Cheers,
David.
It's showing blanks for the username and password
Using database server:
Using database username:
Using database password:
Warning: mysql_connect(): Access denied for user 'xxx'@'localhost' (using password: NO) in /home/xxx/public_html/scripts/test.php on line 6
D
I'm currently importing data using the admin panel. That seems to be workgin fine. So far all import have worked. I'm only importing smaller datafeeds at the moment 109,000 products and counting.
Maybe there is somethgin not right in the common.php file?
Hi Don,
This is really strange as if there was any problem opening the config file there should have been an error generated.
Did you have the automation scripts working before the re-install?
Cheers,
David.
Hmmm, I don't really understand this.
This test will see if $config_databaseUsername is set and is empty:
<?php
require("../includes/common.php");
if (isset($config_databaseUsername))
{
print "database username is set and is '".$config_databaseUsername."'";
}
else
{
print "database username is not set";
}
$link = mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword)
or die("Database Error: " . mysql_error());
print "<p>MySQL Version ".mysql_get_server_info($link)."</p>";
?>
If that prints the message saying database username is set; it implies that this installation of Price Tapestry is not configured. What output do you get?
Cheers,
David.
output:
database username is not set
Warning: mysql_connect(): Access denied for user 'xxx'@'localhost' (using password: NO) in /home/xxx/public_html/scripts/test.php on line 11
Hi,
This test script should print the data from config.php directly. Can you confirm that you see your correct database username and password:
<?php
require("../includes/common.php");
$fp = fopen("../config.php","r");
while(!feof($fp))
{
print fgets($fp)."\n";
}
fclose($fp);
$link = mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword)
or die("Database Error: " . mysql_error());
print "<p>MySQL Version ".mysql_get_server_info($link)."</p>";
?>
(as before, run this in the same directory as import.php)
Cheers,
David.
everything looks good, after the config file was displayed, this was as well
Warning: mysql_connect(): Access denied for user 'xxx'@'localhost' (using password: NO) in /home/xxx/public_html/scripts/test.php on line 9
Is everything else working fine apart from the automation scripts?
I'm afraid i've never seen anything like this before - it just doesn't make sense. I'd need to be able to login to your server and have a look in order to work this out - would you be able to create a temporary password for me to login? Reply to your reg code email or forum registration email with the details if you want me to take a look...
Cheers,
David.
I have been poking around and everything else seems to be working, no errors except when trying to use import.php from a command line or script. Bizarre :(
Hi Don,
It sounds like you may not be executing import.php from the scripts directory. Try using a cd command before import.php in your automation script, for example:
cd /home/you/path/to/pricetapestry/scripts
php import.php @ALL
Regarding your page that uses the search script, it's difficult to tell what is causing that without seeing your code; but it may be that one of the search value is empty, e.g. $q. Can you let me know more about how you've integrated it into your custom page, specifically which Price Tapestry files you have included.
Cheers,
David.