// Create a new socket $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); // An example list of IP addresses owned by the computer $sourceips['kevin'] = '127.0.0.1'; $sourceips['madcoder'] = '127.0.0.2'; // Bind the source address socket_bind($sock, $sourceips['madcoder']); // Connect to destination address socket_connect($sock, $sourceips['madcoder'], 80);.........
I am getting an error Warning: socket_connect() [function.socket-connect]: unable to connect : A socket operation was attempted to an unreachable host. in C:wampwwwsockertsockert.php on line 13
I'm having trouble enabling the socket transport "ssl" in PHP. When I run my script, I get the error: Warning: fsockopen() function.fsockopen]: unable to connect to [URL]... (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) I'm running IIS6 on Windows and this is what I've done so far to try to get it working: uncommented the php_openssl.dll and php_sockets.dll extensions in php.ini made sure PHP was loading the ini file I made changes to (it is, and it's definitely loading other extensions, so I'm fairly sure this isn't the problem) made sure php_openssl.dll and php_sockets.dll were in the correct location copied ssleay32.dll and libeay32.dll to the main PHP folder, the WINDOWS folder and the WINDOWS/system32 folder made sure the Windows path variable included the location of PHP made sure the file permissions were correct on all the relevant files.
I've restarted IIS after pretty much every change, but I haven't had any luck. Is there anything obvious that I'm doing wrong? Is there anyway to troubleshoot this in smaller parts? (So I can figure out the problem by the process of elimination...?) Unfortunately Windows/IIS aren't my area of expertise--I've been put in charge because nobody else seems to know anything.
I'm using swiftmailer, SMTP transport method to send email from my PHP script. Sending the message is fine. It works. The problem is, no matter what I set the FROM,REPLYTO,SENDER settings to, The email comes through as the GMAIL mailbox (ME - me@[URL]) instead.
So the email goes through fine, but instead of being from [URL] as the sender... it's ME-me@[URL] I switch to a separate (non-gmail) SMTP server to test and the email went through fine, without any problems... definitely think it's a GMAIL thing.
I have PHP5.1.2 & Apache on my PC and I'm trying to connect PHP via a socket to a java app acting as a server. I'm failing at the first PHP hurdle. The following line returns
fatal error : Call to undefined function socket_create() in <filename>.php $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
Configuration: Php.ini lines default_socket_timeout = 60 extension=php_sockets.dll extension_dir = "./" ; tried with "./ext" same result... so I coppied php_sockets.dll to php5 root folder enable_dl = On ;maybe not relevant
phpinfo() The only socket related items I can find are Registered Stream Socket Transports | tcp, udp default_socket_timeout | 60
i'm new and trying to learn more about socket programming with php,i write a code with php that will connect to my pc at the port 80,in order to send [get /http /1.1] and then retrieve all the information back to me,but i can't get them to print it out,this is my code:
I wrote a PHP script that needs to connect to port 53 on UDP and on some (shared) servers it doesn't seem to be working. This makes me currious - is it possible that these servers connections on specific ports has been disallowed? If so, how would one go about doing this?
So far I have written a Perl server that runs constantly in the background, when it receives inbound connections a process is forked and that then handles that one connection. What I ultimately want it to be able to do is accept inbound php connections through the socket of course run these commands and then relay and information back. So far I have managed to get this working 100% with a Perl scripted client but it doesn't work 100% with a php one. [Instead of pasting the hole wall of text here is the actual send and receive section.]
As I said this works fine with a perl written client both locally and remotely but doesn't work 100% with php, what I mean by 100% is the fact that the server will recive the command but is unable to send it back, or the server is able to recive the command but the client isnt able to read the reply. Here is the client [php] that I have got working the most.
We are building a daily newsletter based on member preferences. The member can choose a city and some categories among a list of 10. Basically each email will be different. Each email is generated by our server. We are unable to find a provider with an API that can do that. Would you have any solution that ensure a 99% delivery.
I downloaded a PHP script, copied at localhost and when I run it, it will not display all results instruction says that Globals should be off in PHP.ini and scripts should work while Globals are off.but I can't find php.ini in XAMPP. I tried
I tried to include a php script that i downloaded to get me real time money exchange rates, but it uses fopen() function and i get this error: Fatal error: fopen(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?
so i found out that IIS is the problem and i need PHP 4.3+ and OpenSSL(which i don't understand what it is or how to get it) I tried to setup Apache 2 on my windows and use it instead of IIS, and i setup Apache to use port 8080, but when i access any page in /htdocs, The IE tells me that the page can't be displayed.
I want to know how to configure apache and how to run php scripts from it (ofcourse after i configure the httpd.conf file to use php).
Recently i configured Wordpress blog in IIS... I works fine. and Now i try configure the another package(PHP)... it loads the Index page when click on any link it says ** unable to find includes/dbsettings.php**But the file is there in the location and someone said there is problem in path mapping php.ini file....i not PHP Dev..Same package my friend installed works fine for him.
I have this feed of classifieds that I need to convert to an .xml doc. I explode each string into an array (separated by a "|"). Everything work just fine except the string cuts off if there are any line breaks in the 5th section and everything after the break is skipped over and I lose that information.I've tried things like prep_replace & str_replace (looking for things like
char(10) char(13) � x0B), striptags, nl2br. I can't find these breaks and destroy them.
I'm attaching part of the text file that I'm using. I've had it open in Notepad and seen small squares where the breaks are, but that's the only place I've seen that. The first line in the text file is a complete string with no breaks and how the ideal feed would look, after that it hasn't been adjusted.
I have created url shortner by using the link http:[url].....for this i am using EasyPhp188.8.131.52,,but i am not finding the required output,,that means after clicking shortened url it is not redirecting to the original page.Possibly i am thinking the issue is on database side.This is the steps which i did in database side.
First i went to Configuration->PhpMyAdmin link ,,Then i created Database named "leaf" here i didnt selected 'Collation' named dropdown i made table name as "team" with number of fields as "3" then i modified fields like shown below
**Field id url shortened** Type INT VARCHAR VARCHAR
I am building a real-time app & am wondering if I should bother moving from MySQL to MongoDB. My app has a ton of writes happening, though the read cases are higher still. Am currently using XHR on the client-server side but am almost done moving to Socket.io too. My research does make me want to move to MongoDB + Socket.io, but wanted to get some thoughts from the community.
update I am currently defining 'better' by a faster app, if that makes any sense. I am sort of able to live without sql, I 'think'. Currently using 0 JOINs etc. But I was trying to see if anybody out there had any experience moving from MySQL to MongoDB for a 'generic' real-time app.
Im running a file host thats grown beyond the capacity of a single server, and I need to implement multiple server storage of files. I'd like to do this as cheap as possible, so those fancy mass storage methods are out of the question. I simply want to move a file thats uploaded by the user to the "gateway" server, which hosts all the http and mysql, to one of the media servers. It can either be done at the end of the user's request, or via cron every couple of minutes. At this point the only method Im truly familiar with, is using ftp_put php function, and simply ftping the file to a different server, but I've had problems with this method in the past, especially for larger files, and a lot of the files that will be getting transferred will be over 100mb. Preferably Im looking for a purely software solution. hopefully nothing more than a php/bash script.
For a recent project, I have a PHP script running as a CLI-based daemon. This daemon will be responsible for monitoring/controlling independent worker processes.Periodically, users will issue requests to manage workers through a PHP web front-end (CLI daemon and front-end code are on the same physical server). The front-end will need to make method calls to the daemon.I'm confus about how to handle these "remote" method calls. I thought that using a RPC protocol such as JSON-RPC over a standard UNIX or TCP socket would be the way to go, but every implementation of JSON-RPC, XML-RPC, SOAP, etc. for PHP seems to be tightly coupled to HTTP. Since I'm not communicating over the web, HTTP is completely unnecessary.
How can I achieve this: page 1 has a form with textfield1, after clicking submit, page 2 is loaded with another form that also contains textfield1. Can the data that is entered in textfield1 on page 1 automatically be put in textfield1 on page 2?
I'm trying to send an email using the Swift_SmtpTransport but I'm getting the following error: 501 5.5.2 <[::1]>: Helo command rejected: invalid ip address
The SMTP server is a remote server and it works from my production server, but not from my development machine, which is running OS X. It also doesn't bother to throw an exception, instead it required me to use a logger plugin to find out why it wasn't working. What can I do to make it use a real IP address?
I'm trying to add support for the GD extension on my Ubuntu, Apache 2, php box. However my php.ini file does not seem to be the same as most versions of the INI file and it appears that their are no ;extensions comments or a place holder for them. Where did this move to? Is their a new location or new method for adding extensions? I'm at a loss, I only found 2 php.ini files. One for Apache 2 and one for the command line interface. Ultimately I'm asking this question because the normal fix for the error Undefined offset: 1 in [...]images.php on line 50 Fatal error: Call to undefined function imagecreatefrompng() in [...]functions.php on line 309 does not work.