I have a few random basic PHP-related questions:
1) I am trying to install the net_geo PEAR module on my ISP, but I cannot figure out how to tell PHP where I put the modules in my directory. I put them in a folder called mylibs at the top level of the directory, and added the line
ini_set( 'include_path', ini_get( 'include_path' ).PATH_SEPARATOR."/mylibs" );
to my header code, before including the files with:
require_once( "cache/lite.php" );
require_once( "net/geo.php" );
and I get the error
Fatal error: main(): Failed opening required 'cache/lite.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/mylibs')
How do I change the ini_set line to tell PHP where to find the modules?
2) Has anyone used the Net_Geo module for anything, and if so, is it fairly accurate? It seems pretty cool to be able to identify the lat/long coordinates of the user's ISP based on their IP. I noticed on the PEAR site that the module is listed as very out-of-date. I found another module on the site called Net_GeoIP, but apparently you have to pay for the database for that one. On an unrelated note, I am curious how close the lat/long of the user's IP is likely to be to the user's own lat/long. Is it likely to usually be accurate to within 5 miles? 10? 50?
3) Unrelated question: I want to check that the jpeg a user is uploading is exactly 100X100 pixels before moving the upload from the temporary directory to the uploads directory. I know I can get the pixel sizes using getimagesize(), but I cannot figure out how to refer to the temporary directory properly. I cut and pasted the temp directory path from the phpinfo() entry into the function to get the following:
$image_size = getimagesize("C:\WINDOWS\TEMP/$_FILES['upload']");
but that does not work. Can someone tell me what I am doing wrong? (Uploads work fine. I am running PHP locally.)
4) Unrelated question: What is a reasonable maximum number of MYSQL table rows to search, given a standard budget shared hosting ISP and, say, 100 users doing searches at a given time? For example, if I do a search on these forums, I imagine the search must look at several million rows of data. If I pay some web company $10 a month and, say, an average of 100 users are on my site at any one time doing a database search of 4 million rows of text strings, can I reasonably expect it to work? This is speaking very generally, obviously. My knowledge of MySQL is very limited and I am only trying to get my bearings.
1) I am trying to install the net_geo PEAR module on my ISP, but I cannot figure out how to tell PHP where I put the modules in my directory. I put them in a folder called mylibs at the top level of the directory, and added the line
ini_set( 'include_path', ini_get( 'include_path' ).PATH_SEPARATOR."/mylibs" );
to my header code, before including the files with:
require_once( "cache/lite.php" );
require_once( "net/geo.php" );
and I get the error
Fatal error: main(): Failed opening required 'cache/lite.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/mylibs')
How do I change the ini_set line to tell PHP where to find the modules?
2) Has anyone used the Net_Geo module for anything, and if so, is it fairly accurate? It seems pretty cool to be able to identify the lat/long coordinates of the user's ISP based on their IP. I noticed on the PEAR site that the module is listed as very out-of-date. I found another module on the site called Net_GeoIP, but apparently you have to pay for the database for that one. On an unrelated note, I am curious how close the lat/long of the user's IP is likely to be to the user's own lat/long. Is it likely to usually be accurate to within 5 miles? 10? 50?
3) Unrelated question: I want to check that the jpeg a user is uploading is exactly 100X100 pixels before moving the upload from the temporary directory to the uploads directory. I know I can get the pixel sizes using getimagesize(), but I cannot figure out how to refer to the temporary directory properly. I cut and pasted the temp directory path from the phpinfo() entry into the function to get the following:
$image_size = getimagesize("C:\WINDOWS\TEMP/$_FILES['upload']");
but that does not work. Can someone tell me what I am doing wrong? (Uploads work fine. I am running PHP locally.)
4) Unrelated question: What is a reasonable maximum number of MYSQL table rows to search, given a standard budget shared hosting ISP and, say, 100 users doing searches at a given time? For example, if I do a search on these forums, I imagine the search must look at several million rows of data. If I pay some web company $10 a month and, say, an average of 100 users are on my site at any one time doing a database search of 4 million rows of text strings, can I reasonably expect it to work? This is speaking very generally, obviously. My knowledge of MySQL is very limited and I am only trying to get my bearings.