Trouble On Solaris 8
I'm installing Apache 2.2, PHP 5.04, and mySQL 4.0.21 on a Solaris 8
machine using prebuilt binaries from sunfreeware.com.
My apache install went smoothly - the only thing I'm having to work
around is an inability to use /usr/local - it's an NFS mount to a
central image, so I'm installing in /opt/local.
After installing PHP and modifying httpd.conf, I get the following
error on startup:
httpd: Syntax error on line 110 of /opt/local/apache2/conf/httpd.conf:
API module structure `php5_module' in file
/opt/local/apache2/modules/libphp5.so is garbled - perhaps this is not
an Apache module DSO?
Now, I have to confess that I don't have mysql installed yet, but I
would think that simply loading the php module wouldn't require this,
would it?
A search for this message shows one other user has seen it recently,
but no resolution online.
No hint in /var/apache/logs - no mention of php at all in any of the
logs.
Any clues as to what could be causing this?
View Complete Forum Thread with Replies
Related Forum Messages:
PHP 5 On Solaris 5.9
All seems to have installed OK but when I add the lines to Apache as below it gives errors. LoadModule php5_module libexec/libphp5.so AddModule mod_php5.c Syntax error on line 241 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp5.so into server: ld.so.1: /usr/local/apache/bin/httpd: fatal: /usr/local/apache/libexec/libphp5.so: open failed: No such file or directory /usr/local/apache/bin/apachectl start: httpd could not be started AND Syntax error on line 247 of /usr/local/apache/conf/httpd.conf: Cannot add module via name 'mod_php5.c': not in list of loaded modules /usr/local/apache/bin/apachectl start: httpd could not be started PHP seemed to install OK and I search for these modules but they cannot be found. Apache is 1.3.27
View Replies !
Solaris IDE
im kicking around the idea of purchasing a sparc workstation because: 1) they are really cheap on ebay. 2) i always wanted to give one a shot. 3) they are really cheap on ebay. Since i do php development, is there any decent IDE for php development out there that will run on sparc sunos? anyone doing development on a sparc? I'm looking at something like a dual CPU sparc 1000 (dual 750's), and im also curious as to the performance compared to a windoz pc.
View Replies !
Compiling PHP On Solaris
Not sure if this is the best place to ask this, I am trying to compile PHP 5.2 on a Solaris 9 system. I need Oracle DB support so can't use the pre compiled packages on blastwave as I don't think anyof them include Oracle. The configure script is: ../configure --prefix=/usr/local/php-5.2.0 --with-apxs2=/usr/local/apache-2.0.55/bin/apxs --with-mysql=/opt/sfw/mysql --with-pear --with-libxml-dir=/opt/csw/ --with-config-file-path=/etc/php5 --with-curl --with-dom --with-zlib --with-oci8=instantclient,/usr/local/oracle/instantclient_10_2 --with-gd --with-jpeg-dir=/usr/sfw/lib And I get the error: checking for the location of libjpeg... /usr/sfw/lib checking for the location of libpng... no checking for the location of libXpm... no checking for FreeType 1.x support... no checking for FreeType 2... no checking for T1lib support... no checking whether to enable truetype string function in GD... no checking whether to enable JIS-mapped Japanese font support in GD... no checking for fabsf... no checking for floorf... no configure: error: libjpeg.(a|so) not found. BUT [/usr/local/src/php-5.2.0]# ls /usr/sfw/lib <snip> libjpeg.so libjpeg.so.62 So why is it complaining? Does anyone know? I am puzzled why it bales out after the "checking for floorf... no" line and not straight after the libjpeg line 9 lines above. I am using gnu gcc and ld.
View Replies !
PHP Slow On Solaris
Does anybody knows why php runs so damm slow on solaris. PHP works fine, but if you use the array function it get really slow. everyone could try it on different platforms. fill a array with 100.000 elements in a loop and you will see what i mean. debugger output shows that php ist trying to get memory for each element. --> anybody know how to tune this in solaris or php? Code:
View Replies !
With Java On Solaris
This is my system configuration OS Sun Solaris SPARC 8 Apache version 1.3.26(Unix) PHP version php-4.1.0 java version j2sdk1.4.2_14 for soalris i am trying to build php with java support but when i try to configure it with follwing command: ./configure --with-apxs=/usr/apache/bin.paxs --with-java=/usr/j2se --with-config-file-path=/etc --with-openssl=/usr/local/ssl then make and then make install everything goes well without any error. but at the end i dont find any php.ini file in /etc and if i copy it from the distribution of php and edit the file with java class path and library path tha php page using java class doesnt work. can anybody provide me detailed step on how to do java integration in php on solaris.
View Replies !
Installing PHP 5.2.1 On Solaris
I've been following the install guide on the PHP website and everything has gone fine up until where I'm stuck now. I've got Apache installed and running, and I've ran ./configure in the PHP directory with the necessary flags. However, the next step in the process listed in the guide is to do a make. BUt when I do that, this is what I get: Code: make: *** No targets specified and no makefile found. Stop. There's nothing in the install guide that says I have to specify a makefile, and it isn't covered in the FAQ either.
View Replies !
SPARC And Solaris 10
I'm being moved from a windows platform to a Unix platform due to some corporate restructuring. I've been coding .asp pages and was about to move from .asp to .php on windows. Can you tell me: i know that PHP runs on the platform SPARC and Solaris 10, but does it require Apache or can it run on the native Solaris web server?
View Replies !
'rsh' To Solaris 8
When I ran remote shell to a Sun Solaris 8 box from W2K box, the DOS' CMD window popped up and stayed there until CGI timeout. I had to kill the window by clicking on 'x'. After that it displayed CGI timeout error. What was going on? PHP script on Windows 2K: <? php /* Call a script on a remote unix box to display the name */ system <"rsh remoteunix -l thisuser "/mybin/test.sh $firstName $lastName"">; ?> Shell script on Unix box: #!/bin/sh firstName=$1 lastName=$2 echo Your name is: $firstName $lastName exit 0
View Replies !
This Script Is Just A Wrapper For Php (solaris!)
Hi there. Had a look around google and found one post from someone with almost the same error and no reply. SunOS webdb 5.8 I have been trying to install PHP to work with Apache and it all works fine apart from trying to run php from bash. ../configure --with-sybase=/usr/local/freetds --with-tdsver=7.0 --with-apxs=/ usr/apache/bin/apxs --with-mysql=/opt/sfw/mysql --enable-sockets All fine... /opt/sfw/bin/gmake install # echo $LD_RUN_PATH /usr/local/ssl/lib:/opt/sfw/mysql/lib/mysql This all works fine with PHP and Apache but when trying from bash I get the error.. # /usr/local/bin/php /usr/local/bin/php: error: /usr/local/bin/.libs/php does not exist This script is just a wrapper for php. See the libtool documentation for more information. I tried a few more things without success and even tried creating `.libs` incase it was a permission problem when it was compiling - still zilch.
View Replies !
Compiling Php 4.3.4 On Solaris 8 Mysql
Exact output is: ld: fatal: file /opt/sfw/mysql/lib/mysql/.libs/libmysqlclient.so: open failed: No such file or directory ld: fatal: File processing errors. No output written to ..libs/libphp4.so Again, why is it lokking for the MySQL client library in ".libs" ?
View Replies !
PHP On Solaris (2.6) And Integer Overflow
I have PHP version 4.4 installed on a Soaris 2.6 system and I'm getting strange results doing math/boolean operators. I have a hashing algorithm that does multiplication, bitwise operations and mod() calls interatively on the characters of a filename. On a linux platform the multiplications start to overflow (as I expect) and the overflow is just dropped. The lower three bytes are masked off like this: $result = $result & 0x00FFFFFF; and the loop continues. On the Solaris platform the multiplication fails very quickly in the loop, and it looks like the overflow bits are wrapped around onto the lower order bytes, eventually I end up with an interger value of 0x00FFFFFF because of the masking above. To solve the problem I had to compile the gmp_* function support into PHP and work with the gmp_* family of functions.
View Replies !
PHP N Apache Installation On Solaris
Can anyone guide me how to install and configure PHP with Apache on Sun's Solaris 2.7 The details of my Solaris are as follows... Sun Ultra 5/10 System v Release 4.0 Solaris 2.7 SunOS Release 5.7 Generic_106541_06
View Replies !
Connecting To Sql Server From Php (solaris)
I have be assigned to find a way to connect to a SQL server from PHP installed on Solaris 9. It would be very helpfull if someone could guide me on this or give me any useful links. I have read about connecting to sql server from PHP (unix) - will the same work for Solaris version.
View Replies !
Installation Problem (Solaris 8)
i want to compiled PHP 4.3.3 under Solaris 8. My Configuration: Solaris Version 5.8 gcc Version 3.2 PHP 4.3.3 The compile prozess stopped by the compiling the "dns.c" Volker Here is my error log: make /bin/sh /export/home/vpn/src/phprojekt/php-4.3.3/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/standard/ -I/export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/ -DPHP_ATOM_INC -I/export/home/vpn/src/phprojekt/php-4.3.3/include -I/export/home/vpn/src/phprojekt/php-4.3.3/main -I/export/home/vpn/src/phprojekt/php-4.3.3 -I/export/home/vpn/src/phprojekt/php-4.3.3/Zend -I/export/home/vpn/src/phprojekt/mysql-standard-4.0.14-sun-solaris2.8-sparc/ include -I/export/home/vpn/src/phprojekt/php-4.3.3/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -I/export/home/vpn/src/phprojekt/php-4.3.3/TSRM -g -O2 -prefer-pic -c /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c -o ext/standard/dns.lo /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `zif_gethostbynamel': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:186: warning: passing arg 2 of `add_next_index_string' makes pointer from integer without a cast /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `php_gethostbyname': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:206: warning: passing arg 1 of `_estrdup' makes pointer from integer without a cast /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `zif_checkdnsrr': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:228: `T_MX' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:228: (Each undeclared identifier is reported only once /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:228: for each function it appears in.) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:239: `T_A' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:240: `T_NS' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:242: `T_PTR' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:243: `T_ANY' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:244: `T_SOA' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:245: `T_CNAME' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:256: `C_IN' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c: In function `zif_getmxrr': /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:288: `HEADER' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:288: `hp' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:317: `C_IN' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:317: `T_MX' undeclared (first use in this function) /export/home/vpn/src/phprojekt/php-4.3.3/ext/standard/dns.c:324: parse error before ')' token make: *** [ext/standard/dns.lo] Error 1
View Replies !
Problems Compiling PHP 4.3 On Solaris 8
I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error message it is showing: -- start -- Undefined first referenced symbol in file php_parse_date ext/standard/datetime.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `sapi/cli/php' -- end -- The most common suggestiong I found while searching google was to upgrade GCC from 2.95 to the latest. I upgraded both the GCC and the libgcc packages and the error still continues. I also tried rolling back to an earlier version (4.3.3) unsuccessfully.
View Replies !
Install Problem Of 5.2.4 On Solaris 8
when I try to ./configure ... I get error about xml2-config is to old, and its pointing to a /usr/local/bin. but I have libxml2 and xml2-config install in /opt/csw/bin So how do I tell php ./configure to use the xml2-config thats in /opt/csw/bin?
View Replies !
Adding Negative Numbers On Solaris
I get an unexpected result when I add two negative numbers in PHP on SPARC/Solaris 8. The same program works fine on Intel/Linux. I'm using PHP 4.3.1 on both systems. Here is my program, test.php. <?php $a = 0x81234567; $b = 0xF0000002; printx($a, $b); printx($a, intval($b)); printx(intval($a), $b); printx(intval($a), intval($b)); function printx($a, $b) { $c = $a + $b; printf("%08X (%u) %7s + %7s = %7s ", $c, $c, gettype($a), gettype($b), gettype($c)); } ?> I run it from the shell prompt like this: php -f test.php Output on Intel/Linux, PHP 4.3.1 71234569 (1898136937) double + double = double 71234569 (1898136937) double + integer = double 71234569 (1898136937) integer + double = double 71234569 (1898136937) integer + integer = double This is the answer that I expect. I am adding two 32-bit integers, and the value overflows. Here is what happens when I run it on SPARC/Solaris 8, PHP 4.3.1 FFFFFFFF (4294967295) double + double = double 71234569 (1898136937) double + integer = double 71234569 (1898136937) integer + double = double 80000000 (2147483648) integer + integer = double When both arguments are negative doubles or both are negative integers, then it gives the wrong answer. What is causing this, and how do I avoid this strange behavior?
View Replies !
Can't Build Apache/PHP/MSSQL On Solaris
Having read everything I can, and compiled apache/php 30/40 times, I cannot seem to get a static version of PHP working with FreeTDS. I know the FreeTDS drivers for MSSQL are working, cos it took minutes to install the Perl Drivers. However, the PHP drivers just will not work ! The BBs/Forums all seem to complain about exactly the same problem, and the only success stories are for Linux. Is this because PHP isn't supported as well as Perl ? Has anyone out there got PHP running on Sparc to talk to an MSSQL server ?
View Replies !
PHP 5.0.1, Solaris 5.9, Sablotron 1.0.2, Config Problems
Can run sabcmd with no problems. But when running a simple php script, it cannot find the sablotron functions. So it does not appear to be linking the Sablotron stuff. Probably just something simple I am missing. Built with: configure --with-xml --with-expat=/usr/local --enable-xslt --with-xslt-sablot=/usr/local Simple PHP script: <?php $parser = xslt_create(); $html= xslt_process($parser, "test.xml", "test.xsl"); xslt_free($parser); echo $html; ?> Returns: Fatal error: Call to undefined function xslt_create() in /tmp/xsl.php on line 2
View Replies !
Xampp For Solaris X86, Need Zipped File
trying to get xampp....0.8.1.sh for solaris 9 x86. I only have access to the web via a windows box to download the .sh file. Windows corrupts the file so can not get it to the unix box tied up behind a firewall. Can anyone do a gzipped version of the xampp file for me?
View Replies !
Installing Php With Curl On Solaris 8 Problem
I want to install php (4.1.2 4.2.1 4.3.1 whatever) on solaris 8 i gave up instaling curl 7.9 so i managed to install curl 7.8.1 from sunfreeware and then tried to install php ,i had to install a couple of packages like gd ,gdbm and etc and then i could pass the configure phase! but during make i got this error: curl.c: In function `zm_startup_curl`: curl.c:176: `CURLPOT_COOKIRJAR` undeclared (first use in this function) <and a few similar errors> on google i found a posting which said my curl version is low but i already have this version of curl and php running on linux ....any idea?
View Replies !
Decimal Parts On Solaris (PHP+ZendOptimizer)
I have problem with decimal parts on Solaris (PHP+ZendOptimizer). When I get value from MySQL (or from text file - I have had the same), it is loosing decimal parts. For example, let say, that from MySQL I have $line[myvalue]=123.45 Then if I will do this: Code:
View Replies !
SunONE 6.1 / 4.3.8 / Solaris 8 -> _db_return_ Errors In Log Files
we have a server which has lots of errors of this type: [09/Nov/2004:15:19:21] info (25982): CORE3261: Crash occurred in NSAPI SAF php4_execute [09/Nov/2004:15:19:21] info (25982): CORE3262: Crash occurred in function _db_return_ from module /sunone/bin/libphp4.so [09/Nov/2004:15:19:21] failure ( 1091): CORE3107: Child process closed admin channel We are running SunONE 6.1 (formely iPlanet) on a Solaris 8 server with PHP 4.3.8 (but this problem was appearing from 4.3.3). We can't seem to find a pattern to make these lines appear in the logs..
View Replies !
Solaris 9: Can't Build Libjpeg Shared Object
I realize this is the php group, but I have a question that recurses back to my php install. My objective is a pure 64 bit shared object installation of php 5.0 on UltraSparc Solaris 9 compiled with the Sun Compiler version 8. My problem is that EVERYTHING builds great EXCEPT that the 6b distribution of JPEG will NOT build a shared object, thus gd cannot include support for JPEG, thus php loses that functionality. ** Configuration summary for gd 2.0.28: Support for PNG library: yes Support for JPEG library: no Support for Freetype 2.x library: yes Support for Xpm library: yes Support for pthreads: yes Yes, I've seen the install.doc from jpeg-6b: "* If you want to build libjpeg as a shared library, say ./configure --enable-shared" Here's that output: 1 [gis 9] ~/jpeg-6b > ./configure --enable-shared 2 checking for gcc... /opt/SUNWspro/bin/cc 3 checking whether the C compiler (/opt/SUNWspro/bin/cc -fast -xarch=v9a -xO5 ) works... yes 4 checking whether the C compiler (/opt/SUNWspro/bin/cc -fast -xarch=v9a -xO5 ) is a cross-compiler... no 5 checking whether we are using GNU C... no 6 checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -E 7 checking for function prototypes... yes 8 checking for stddef.h... yes 9 checking for stdlib.h... yes 10 checking for string.h... yes 11 checking for size_t... yes 12 checking for type unsigned char... yes 13 checking for type unsigned short... yes 14 checking for type void... yes 15 checking for working const... yes 16 checking for inline... inline 17 checking for broken incomplete types... ok 18 checking for short external names... ok 19 checking to see if char is signed... yes 20 checking to see if right shift is signed... yes 21 checking to see if fopen accepts b spec... yes 22 checking for a BSD compatible install... /usr/local/bin/install -c 23 checking for ranlib... ranlib 24 LTSHARED is yes 25 ------------> I am using libtool in /usr/local/bin/libtool 26 checking host system type... sparc-sun-solaris2.9 27 checking for ranlib... ranlib 28 checking whether we are using GNU C... no 29 checking for /opt/SUNWspro/bin/cc option to produce PIC... -KPIC 30 checking if /opt/SUNWspro/bin/cc PIC flag -KPIC works... no 31 checking if /opt/SUNWspro/bin/cc static flag -Bstatic works... none 32 checking whether ln -s works... yes 33 checking for non-GNU ld... /usr/ccs/bin/ld 34 checking if the linker (/usr/ccs/bin/ld) is GNU ld... no 35 checking whether the linker (/usr/ccs/bin/ld) supports shared libraries... yes 36 checking for BSD-compatible nm... /usr/ccs/bin/nm -p 37 checking command to parse /usr/ccs/bin/nm -p output... yes 38 checking how to hardcode library paths into programs... immediate 39 checking for /usr/ccs/bin/ld option to reload object files... -r 40 checking dynamic linker characteristics... solaris2.9 ld.so 41 checking if libtool supports shared libraries... no 42 checking whether to build shared libraries... no 43 checking whether to build static libraries... yes 44 checking for objdir... .libs 45 creating libtool 46 checking libjpeg version number... 62 47 creating ./config.status 48 creating Makefile 49 creating jconfig.h 50 jconfig.h is unchanged 51 [03:35 - 0.21] As you can see from line 41 above, configure is convinced libtool cannot support shared libraries. I modified the configure script to output the location of the libtool being used (line 25) and the value of LTSHARED (line 24). Has ANYONE out there successfully milked out a shared object from the 6b distribution of libjpeg ?? This is the only thing holding up my build.
View Replies !
Solaris/Apache, Child Pid 3383 Exit Signal Segmentation
I cant get php to work on soalaris 8 when I start apache: [Mon Mar 8 11:39:59 2004] [notice] Apache/1.3.27 (Unix) PHP/4.3.2 configured -- resuming normal operations but when I got to my test.php page: which is <?php phpinfo(); ?> Then I get a page cannot be displayed page. then in the apache error logs: Mon Mar 8 11:40:32 2004] [notice] child pid 3383 exit signal Segmentation Fault (11) [Mon Mar 8 11:40:32 2004] [notice] child pid 3382 exit signal Segmentation Fault (11) [Mon Mar 8 11:41:31 2004] [notice] child pid 3384 exit signal Segmentation Fault (11) What do I need to do? I installed the SFWmphp package from soalris 9 which I installed on solaris 8.
View Replies !
PHP Install Core Dump "make Install" PEAR On Solaris 9
php has been configured with the following two configure lines and core's during "make install" on the PEAR section. Is there something simple i'm missing? Any help would be appreciated. Environment: Solaris 9 php 5.2.1 GNU Make 3.81 gcc 4.1.1 ../configure --prefix=/opt/foo/php5 --enable-force-cgi-redirect -- enable-discard-path --enable-fastcgi --with-curl=/opt/foo --enable- sockets --with-zlib=/opt/foo --with-libxml-dir=/opt/foo --with- openssl=/opt/foo --with-nsapi=/opt/foo/sunone/current --enable-ftp -- with-ldap=/opt/foo/openldap --with-snmp=/opt/foo/net-snmp --enable- soap --with-xsl=/opt/foo --enable-libgcc --with-mysql=/opt/foo/mysql -- with-pear .....
View Replies !
SQL Trouble With OR And AND
What I'd like to say with this SQL is this: "I want all from mcContentBlocks where the type equals $infoToBeSought1 and where the type doesn't contain "delete". I need for either cbBelongsToWhichPage, or cbBelongsToMasterPage, or cbBelongsToTopLevelMasterPage to equal $infoToBeSought2. All the entries I want reside in one table. What is the correct way to say this? I seem to be getting all kinds of trouble because of my use of "OR". $this->query = "SELECT * FROM mcContentBlocks WHERE cbWhichType='$infoToBeSought1' AND cbWhichType NOT LIKE '%delete%' AND cbBelongsToWhichPage=$infoToBeSought2 OR cbBelongsToMasterPage=$infoToBeSought2 OR cbBelongsToTopLevelMasterPage=$infoToBeSought2 OR AND cbBelongsToWhichWebsite='$this->cbBelongsToWhichWebsite' ORDER BY cbId";
View Replies !
PHP Trouble
I have post this before but I wan't as clear before so I will try and explain. I am presuming you have all heard of Stock Trading Games. Well I want to create my own one. Except you buy and sell Bands. How would I go about doing this?
View Replies !
Sql Trouble
i have this query: select sno, fname&" "&lname as name, address, tel_no, position, sex, dob, salary, nin, bno from staff order by salary desc; it contains all the fields in the table, but i wanted to have the fname and lname as on column, how can i do that but not have to write all the fields out?
View Replies !
Trouble With GD
I am attempting to make a counter using GD v2.0. I have everything working, right up to when it is supposed to show the image. It is pulling information out of the database, and updating it with the new count, but I am getting the missing image box instead of the counter. I have been looking through this code endlessly, and I can't find any problem with it. Code:
View Replies !
Trouble With MIN Value
I have a problem in using the MIN function for MYSQL I want to get the supplier of the lowest cost of a product inside a table based on product name I currently have this data set... Name | Cost | SupplierName ProductA | 24.70 | SupplierA ProductA | 22.00 | SupplierB And my initial work produced the following query, SELECT SupplierName, MIN(cost) as mincost FROM tableName GROUP BY Name What it gives me is the minCost value but it does not give me the right supplier. How can i get it right? I did try the HAVING clause but that just limited my result set.
View Replies !
Trouble With '>' Character
I'm trying to get the '>' in a string into a variable but it doesn't display and everything in front it of disappears. I've tried using '' to escape it but this has no effect. What a m I missing?
View Replies !
More Trouble With Images
I've decided to store images directly into mysql. I have been advised not to do this but can't figure out what else to do. Why for the life of me can't I pull the images back out!!!! Does anyone know what the best way to deal with these images is!? Should I go back to using pointers? If so, please give me an example of how to output the images correctly. Or, tell me what I've done wrong here... <? mysql_connect("","",""); $query="select * from "; $result=mysql_db_query("",$query); $rows=mysql_num_rows($result); if($rows<1) { print "No Image"; } else { $photo=mysql_fetch_object($result); Header("Content-type:image/jpeg/gif"); $body=$photo->image; echo $body; flush(); } ?>
View Replies !
Del.icio.us Api Trouble
Why doesn't this code work? I get an empty response back from del.icio.us. It does open the socket and send the http request. I can get the api to work fine using cURL, but I wanted to try this. Any insight appreciated. <?php $host = 'api.del.icio.us' $port = 443; $username = 'username' $password = 'password' $request = "GET https://$host/v1/posts/recent?count=5 HTTP/1.0"; $request .= "Authorization: Basic " . base64_encode("$username:$password" ) . ""; $request .= "User-Agent: PHP script/0.1"; $request .= "Host: $host"; $request .= ""; $fp = fsockopen( $host, $port, $errno, $errstr, 30 ) or die( $errno .': ' . $errstr ); fwrite( $fp, $request ) or die( $errno . ': ' . $errstr ); $response = '' while( !feof( $fp ) ) { $response .= fread( $fp, 8192 ); } echo "response is " . htmlspecialchars( $response ) . ""; fclose( $fp ); ?>
View Replies !
Trouble With Preg_replace
I'm trying to fix a line that looks like this: 123 MAIN STREET ANYTOWN "$729,950 " DE 1582 3 2 To look like this: 123 MAIN STREET|ANYTOWN|$729950|DE|1582|3|2 I have no trouble getting it to convert the tabs to | with $export = preg_replace( '/ /', '|', $export); But I can't seem to get the double quotes (") out of the price field I use this: $export = preg_replace( '/"$/', '$', $export); and wind up with this: 123 MAIN STREET|ANYTOWN|"$729,950 "|DE|1582|3|2
View Replies !
Php Sessions Trouble
i have got this sessions authentication script and it doesn't work properly. every new protected page you go to it requires you to login again. PHP Code:
View Replies !
Jpg Header Trouble
I'm trying to setup a function which could resize some jpgs 'on the fly', I want them to be displayed into the browser. Here is my function: function Get_Redim_Jpg($file_jpg){ Header("Content-type: image/jpeg"); $src_im = ImageCreateFromJpeg($file_jpg); $size = GetImageSize($image); $src_w = $size[0]; $src_h = $size[1]; $dst_w = floor($src_w / 3); $dst_h = floor($src_h / 3); $dst_im = ImageCreateTrueColor($dst_w,$dst_h); ImageCopyResampled($dst_im,$src_im,0,0,0,0,$dst_w, $dst_h,$src_w,$src_h); ImageJpeg($dst_im); ImageDestroy($dst_im); imageDestroy($src_im); } and use it like that : '<img src="'.Get_Redim_Jpg("my_jpg").'"> So I must use header function to get it displayed as a jpg. but I get the 'headers already sent' error.. I don't really see where I have to user header function to avoid errors...
View Replies !
Trouble Tickets
Anybody an idea which phpscript I could use for a helpdesk. E-Mail messages sent to support@blabla.com should automaticaly being transfered to the system and email the user back with a ticketnumber. After that ofcourse should be the rest for handling the tickets.
View Replies !
Trouble Using $HTTP_RAW_POST_DATA
I need to have the contents of $HTTP_RAW_POST_DATA because of non-regular uploads (from a browser to my home-made WebDAV-server). However, no matter what I do, it is always NULL. I guess the following script should return SOMETHING in $HTTP_RAW_POST DATA if "always_populate_raw_post_data 1" is added to the php.ini file (and yes, I've restarted apache :-)... so, why is it empty and how can I get the RAW post data? test.php: <form action="<?echo($PHP_SELF)?>" method="post"> <input type="text" value="you-suck"> <input type="submit"> </form> <?php echo("Raw post data: ".$HTTP_RAW_POST_DATA."<br> "); echo("Raw post data decoded: ".base64_decode($HTTP_RAW_POST_DATA)."<br> "); echo("<hr>"); phpinfo(); ?>
View Replies !
Trouble Connecting With FTP
I'm using PHP 4.3 on Apache 2, connecting to a VSFTP server running on Fedora Core 5. The Fedora machine is my home computer, which sits behind a router. I have opened up the FTP port, and I can connect fine from an FTP client if I'm using active mode. However the following code fails to upload a file // set up basic connection $conn_id = ftp_connect($ftp_host); if ($conn_id) { // login with username and password $login_result = ftp_login($conn_id, $ftp_user, $ftp_pwd); if ($login_result) { // Disable passive mode ftp_pasv($conn_id, false); // upload the file $remote_path = "$ftp_dir/" . SQL_PRODUCT_SHORT_FILE_NAME; ftp_delete($conn_id, $remote_path); // line 96 $upload = ftp_put($conn_id, $remote_path, $sql_file_path, FTP_ASCII); // check upload status if (!$upload) { die("FTP upload has failed!"); } with the following Warning: ftp_put() [function.ftp-put]: Failed to establish connection. in /usr/local/apache2/htdocs/super_admin_rs/sa_prod_fns.php on line 96 FTP upload has failed! I have verified that the file in question exists. Any other ideas on how I can troubleshoot this problem?
View Replies !
Next / Previous Trouble
Can anyone tell me what I'm doing wrong with this code? The first page displays just fine, and the next/previous links work, but the data that displays on page two is just a repeat of the first data set, so in other words I get the same results with test.php3?start=6 as I do with test.php3?start=0, even though there are more unique records it should be displaying my code:
View Replies !
Trouble With Arrays
I'm trying to modify a shopping cart script from Mastering PHP/MySQL and am having trouble setting up some arrays for it. The original code, below, stores the cart items in a session variable array ($HTTP_SESSION_VARS['cart'] = array();) basically this stores an associative array with the id number of the product and the qty (ie cart[$productid] = qty of that product). This works fine, but I need to be able to have sub options AND colours for some (but not all) products. I don't know exactly what to do here, I know I need some kind of array using a combination of the productid,colour and option as the key for it. then storing the quantity of the item in that (and if possible price). Here is the code that sets up the session variables and updates the quantity if an item is already in there (the array I'm trying to modify is the 'cart' one, $new is the productid of the new item to add (and $newcolour,$newoptions will be the colour and option for the new item)). if($new) { //see if a product has been specified if(!isset($HTTP_SESSION_VARS['cart'])) { //see if session variables have been set $HTTP_SESSION_VARS['cart'] = array(); //if not create them $HTTP_SESSION_VARS['items'] = 0; $HTTP_SESSION_VARS['total_price'] =Ɔ.00' } if(isset($HTTP_SESSION_VARS['cart'][$new]{ //check if there is already a value in cart array for that product $HTTP_SESSION_VARS['cart'][$new]++; //if so increase quantity } else { $HTTP_SESSION_VARS['cart'][$new] = 1; //otherwise just put one item in } $HTTP_SESSION_VARS['total_price'] = calculateprice($HTTP_SESSION_VARS['cart'],$dbproducts); //update total price $HTTP_SESSION_VARS['items'] = calculateitems($HTTP_SESSION_VARS['cart']); //update total items } if(isset($save)) { //check if this is an update foreach ($HTTP_SESSION_VARS['cart'] as $productid => $qty) { //go through each item in the cart (session) if($HTTP_POST_VARS[$productid]==Ɔ') { //check if quantity set to 0 unset($HTTP_SESSION_VARS['cart'][$productid]); //if item is removed then remove from cart array } else { $HTTP_SESSION_VARS['cart'][$productid] = $HTTP_POST_VARS[$productid]; //change quantity } $HTTP_SESSION_VARS['total_price'] = calculateprice($HTTP_SESSION_VARS['cart'],$dbproducts); //re claculate price and no. items $HTTP_SESSION_VARS['items'] = calculateitems($HTTP_SESSION_VARS['cart']); } }
View Replies !
Trouble With PHP Formmail
I'm using PHP 4.4.4 and have downloaded the free script formmail.php (version 4.1b). Wondered if anyone had experienced the same problem I'm having. I'm submitting a form to formmail.php, but none of the variables seem to be getting recognized. Here is part of the form I'm submitting ... <body onload="document.forms[0].submit();"> Sending Order ... <form action="formmail.php" method=post enctype="application/x-www-form-urlencoded"> <INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee"> <INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.html"> <INPUT TYPE="hidden" NAME="recipient" VALUE="laredotornado@gmail.com"> .... </form> </body> but then I get warnings like below ... Notice: Undefined variable: recipient in /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 365 Notice: Undefined variable: required in /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 383 Notice: Undefined variable: require in /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 388 Notice: Undefined variable: email in /usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 429 but as you can see above, "recipient" and "email" are clearly defined. What am I doing wrong?
View Replies !
Trouble With Pg_connect
I'm having some troubles getting pg_connect() to connect over UNIX domain sockets. Something that really confuses me is the error string being served up by apache. It says it was unable to connect to database xxxx. However, the characters are gibberrish. At first I thought that my problem was that I forgot to give the user name also (seeing there was no apache user in postgresql). However that wasn't it. To make sure though, I added an apache username to the postgresql server. Currently, my pg_connect looks like this: $dbconn = pg_connect("dbname=mydb user=andy"); I have checked the pg_hba.conf file, but that shouldn't be it as I can connect via psql over UNIX domain. However, given my current predicament,
View Replies !
Mysql_result Trouble
I can't understand why when I execute a query : $select = "SELECT nom_utilisateur, mot_de_passe, nom,prenom,date_de_naissance, site_internet,avatard,email FROM utilisateur WHERE nom_utilisateur = '$nom_utilisateur'"; $req = mysql_query($select) or die('Erreur SQL !'); $nom = mysql_result($req,0,"nom"); $prenom = mysql_result($select,0,"prenom"); $adresse = mysql_result($select,0,"adresse"); $email = mysql_result($select,0,"email"); I only can print $nom value anybody see ?
View Replies !
Trouble Including CGI With PHP.
I am in the process of switching my site over to PHP, and one of the things I will be altering is exchanging my current server-side includes for PHP includes. I've managed to find PHP equivalents for most of my current includes, but I am struggling with the script (RatLog) that I use for counting creating my referral logs. php include() doesn't seem to work on CGI, so I am having to use php virtual(). However, I can only get virtual() working with a path relative to root, not with the full path. But since I also plan to turn some sections into subdomains, my understanding is that relative to root will only work for the main domain, not the subdomains. Can CGI be included using PHP in any other fashion? Is it perhaps a configuration issue with my host that is causing this problem? When I use php include() for regular files, they only work with full server path, not with a relative-to-root path. The version of PHP on the server is 4.3.7.
View Replies !
Trouble With Set_error_handler()
I call this function at the top of the page, does that mean that the function sendErrorsPhpToPds() is now called everytime there is an error? Does this still work if I also go error_reporting(0); ? function setErrorHandlingToEmail() { // 11-22-04 - this is listed at the top of configPublicEvents.php and configAdminEvents.php. // The idea here is that we want to send all PHP errors to myself, so I can have a better // idea about where the software is screwing up. $old_error_handler = set_error_handler("sendErrorsPhpToPds"); }
View Replies !
|