clem_c_rock
-
Posts
20 -
Joined
-
Last visited
Never
Posts posted by clem_c_rock
-
-
Hello,
I just ported a site over to a new server w/ a newer version of php.
I am having a strange problem using the extract() function to extract contents of a mysql_fetch_array.
I know it's the extract function because when I comment it out the page loads with no problem.
here's my code:
$sql_select = "select property.*, layout.* from property,layout where property.property_id=$property_id and layout.property_id=$property_id"; $result = mysql_query ($sql_select, $conID); $row = array(); while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ extract($row); }
Any ideas on why this is happening?
thanks for your time!
-
Hello,
I have a script that suddenly stopped working and nothing's been changed. I am using the php mail() function to send a simple email form and the mail() function report true when it is fired off but I can never receive the emails.
I suspect something's changed in our hosting but wanted to rule everything out before I started investigating there.
Here's the simple code I am using:
$send_tenant_mail = mail( $tenant_email, $subject, $body_header, "From: $from\nReply-To: $from\n" ); if($send_tenant_mail == 1) { $confirm = "A Confirmation Email has been sent to: $tenant_email"; }
Thanks,
Clem C
-
I ran: sudo apt-get remove apache2
and then reinstalled apache w/ sudo apt-get install apache2
Then when I restarted the server, I got the same error as before.
Just don't get it
-
One thing I should mention, when I start commenting out the module includes the next one in line shows up as 'garbled'.
Behold:
When I comment out line #66 it just says the next module is garbled:
httpd: Syntax error on line 67 of /etc/apache2/httpd.conf: API module structure `cache_module' in file /usr/lib/apache2/modules/mod_cache.so is garbled - perhaps this is not an Apache module DSO?
and if I comment out line 68 I get:
httpd: Syntax error on line 68 of /etc/apache2/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_mem_cache.so into server: /usr/lib/apache2/modules/mod_mem_cache.so: undefined symbol: apr_atomic_dec
and then I comment out the next one I get:
httpd: Syntax error on line 71 of /etc/apache2/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_ext_filter.so into server: /usr/lib/apache2/modules/mod_ext_filter.so: undefined symbol: apr_poll_socket_add
and so on.
Something is all messed up.
-
Here's what I got when I ran dpkg --list | grep php:
ii libapache2-mod-php5 5.1.2-1ubuntu3.9 server-side, HTML-embedded scripting languag
ii php5 5.1.2-1ubuntu3.9 server-side, HTML-embedded scripting languag
ii php5-common 5.1.2-1ubuntu3.9 Common files for packages built from the php
ii php5-mysql 5.1.2-1ubuntu3.9 MySQL module for php5
ii php5-mysqli 5.1.2-1ubuntu3.9 MySQL Improved module for php5
ii phpmyadmin 2.8.0.3-1 set of PHP-scripts to administrate MySQL ove
-
I ran: sudo apt-get install apache2 php5
And got:
Reading package lists... Done
Building dependency tree... Done
apache2 is already the newest version.
php5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
Sounds like somethings strange that the newest versions of these aren't compatable
-
This is what I have around line 66 (I don't see anything wrong on line 66)
LoadModule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so
LoadModule authn_dbm_module /usr/lib/apache2/modules/mod_authn_dbm.so
LoadModule authn_anon_module /usr/lib/apache2/modules/mod_authn_anon.so
LoadModule authn_dbd_module /usr/lib/apache2/modules/mod_authn_dbd.so
LoadModule authn_default_module /usr/lib/apache2/modules/mod_authn_default.so
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
LoadModule authz_groupfile_module /usr/lib/apache2/modules/mod_authz_groupfile.so
LoadModule authz_user_module /usr/lib/apache2/modules/mod_authz_user.so
LoadModule authz_dbm_module /usr/lib/apache2/modules/mod_authz_dbm.so
LoadModule authz_owner_module /usr/lib/apache2/modules/mod_authz_owner.so
LoadModule authz_default_module /usr/lib/apache2/modules/mod_authz_default.so
LoadModule auth_basic_module /usr/lib/apache2/modules/mod_auth_basic.so
LoadModule auth_digest_module /usr/lib/apache2/modules/mod_auth_digest.so
LoadModule cache_module /usr/lib/apache2/modules/mod_cache.so
LoadModule mem_cache_module /usr/lib/apache2/modules/mod_mem_cache.so
LoadModule dbd_module /usr/lib/apache2/modules/mod_dbd.so
LoadModule dumpio_module /usr/lib/apache2/modules/mod_dumpio.so
LoadModule ext_filter_module /usr/lib/apache2/modules/mod_ext_filter.so
LoadModule include_module /usr/lib/apache2/modules/mod_include.so
LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
Also, when I try sudo apt-get apache2 php5
I get this:
E: Invalid operation apache2
-
Hello,
I have installed Apache 2.2.4 and php 5.2.4 on my Ubuntu platform and when I do sudo httpd -k restart
I get this:
httpd: Syntax error on line 66 of /etc/apache2/httpd.conf: API module structure `auth_digest_module' in file /usr/lib/apache2/modules/mod_auth_digest.so is garbled - perhaps this is not an Apache module DSO?
I know I have a php version that's not working w/ my Apache 2.2.4 but I'm not sure about how to find the correct version of PHP that will work w/ this version of Apache.
Anyone know the best way to resolve this?
Thanks,
Clem C
-
Hello,
I have a Flash application that's sending data from a simple input dynamic text field to a php script that saves it to a database. I then retrieve the data from the database and export it to a csv file. I am having problems w/ the wrapped text from the flash application causing the csv file to display the text in a newline.
When I try to detect the usual newline characters, (IE. \n, \r, \n\r) I am not finding any in the text.
here's the line of php code i'm using to try to detect any newline chars:
[code]
if(preg_match("#[\n|\r|\r\n][ ]*$#", $row_export['data_dump'] ) ){ echo "Newline characters found!"; }else{ echo "NO NEWLINES OR CARRIAGE RETURNS"; }
[/code]
Is there any different newline or wrap characters that I could be testing for?
Thanks,
Clem C -
Hello,
I'm trying to create thumbnails w/ the imagejpeg(): and no matter what directory I try to reference w/ the function and no matter what permissions I give any folder, I still get this error:
Warning: imagejpeg(): Unable to open '../' for writing in /home/content/e/r/i/eric68/html/admin/catalogue/catalogue_admin.php on line 124
here's the function I'm using:
[code]
function thumb( $filename, $destination, $th_width, $th_height, $forcefill )
{
list( $width, $height ) = getimagesize( $filename );
$source = imagecreatefromjpeg( $filename );
#$filename = '../../uploaded_gallery_photos/global_album_photos/25_tn_bgfish.jpg';
if( $width > $th_width || $height > $th_height )
{
$a = $th_width/$th_height;
$b = $width/$height;
if( ( $a > $b ) ^ $forcefill )
{
$src_rect_width = $a * $height;
$src_rect_height = $height;
if(!$forcefill)
{
$src_rect_width = $width;
$th_width = $th_height/$height*$width;
}
}
else
{
$src_rect_height = $width/$a;
$src_rect_width = $width;
if(!$forcefill)
{
$src_rect_height = $height;
$th_height = $th_width/$width*$height;
}
}
$src_rect_xoffset = ( $width - $src_rect_width ) / 2*intval( $forcefill );
$src_rect_yoffset = ( $height - $src_rect_height ) / 2*intval( $forcefill );
$thumb = imagecreatetruecolor($th_width, $th_height);
imagecopyresized( $thumb, $source, 0, 0, $src_rect_xoffset, $src_rect_yoffset, $th_width, $th_height, $src_rect_width, $src_rect_height );
echo "<br>thumb-->>$thumb || filename-->>$filename || destination-->>$destination";
#imagejpeg( $thumb, $destination );
imagejpeg( $thumb, '../', 100 );
}
}
[/code]
Just don't get it.
Clem C -
PROBLEM SOLVED!
The problem was that I was trying to grant the security permissions through IIS manager instead of simple old explorer. I just had to grant the default web viewing (in our case: IUSR_WW251) group permissions to the folder where the scripts were being read.
Here's what I did:
Windows Explorer >> Parent folder where scripts are reading/writing to files >> Sharing and Security >>
Security tab >> Add >> Advanced >> Find Now >> choose default web user (IUSR_WW251) >> OK >> OK -
Hello,
I'm trying to find out how to set the file permissions on an IIS server so I can execute file handling functions such as fopen, fputs, fclose ect.
I know this is pretty basic but I've yet to find a solution.
thanks for your help!
Clem C -
Ok - got it!!
Actually mysql and PHP were running fine after I changed the extension_dir to the correct directory.
The Problem after that was w/ phpMyAdmin and it's configuration.
Here's what I did to fix that:
[code]
'host' from localhost to the machine host name 'extension' to 'mysqli' 'user' to a user who has access to MySQL, i.e. can log onto MySQL on the server 'password' to the password of the user
[/code]
-
Yeah there is - and it looks a bit problematic to me:
[code]
Active Persistent Links 0
Active Links 0
Client API version 4.1.7
Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off
[/code]
Any Suggestions? -
Well, I got that error fixed by pointing the extension_dir to the correct directory.
Now I have another error which is: "Cannot load mysql exten
sion" when I go to phpMyAdmin.
-
Well, I fixed the first error by setting the extensions_dir to the correct path but now I have another error when I go to phpMyAdmin: "Cannot load mysql extension".
PHP was working fine before I blew it up so I'm pretty confident that the PATH variable is set correctly.
Thanks for your time.
-
Hello,
I have screwed up something on my php.ini file on a windows server and now I am getting this error: "unable to load dynamic library C:\php5\php_mysql.dll". Now, my PHP installation actually resides here: C:\PHP\ so, obviously, it's pointing to the wrong address.
Where do I change this so the program is looking in the right directory?
Thanks,
Clem C -
I found it - the combonation of <?=stripslashes( htmlentities( $var ) ) ?> worked beautifully.
Why haven't I ever used htmlentities()?
Thanks again all
Much obliged! -
Hello,
This is rather embarassing given my 4 years of php coding experience but I've noticed when I'm pulling quoted text from a database into a input text field, the entire text w/in the quotes, and the quotes themselves disappears.
For instance, if I try to echo this string: this is "text", only the string: this is will show up in the text input box.
I know there has to something stupid I'm missing
Thanks,
Clem C
large query causing timeout
in MySQL Help
Posted
Hello,
I have this large inner join query that is causing frequent timeouts on our server and I was wondering if there was anyway I could streamline it so it would work all the time. The strange thing is that when I copy and paste this query into phpMyAdmin, it runs in 0.0711. I've tried many different versions of this as a regular join table and this query below:
Any help would be greatly appreciated.