Search Results

Search found 34397 results on 1376 pages for 'php socket'.

Page 7/1376 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Socket read() hangs for a while when there is no data to read.

    - by janesconference
    Hi' I'm writing a simple http port forwarder. I read data from port 80, and pass the data to my lighttpd server, on port 8080. As long as I write() data on the socket on port 8080 (forwarding the request) there's no problem, but when I read() data from that socket (forwarding the response), the last read() hangs a lot (about 1 or 2 seconds) before realizing there's no more data and returning 0. I tried to set the socket to non-blocking, but this doesn't work, as sometimes it returns EWOULDBLOCKING even if there's some data left (lighttpd + cgi can be quite slow). I tried to set a timeout with select(), but, as above, a slow cgi could timeout the socket when there's actually some data to transmit. How would you do?

    Read the article

  • Settings on php.ini ignored

    - by bfavaretto
    I can't get my server to obey the settings from php.ini (I'm trying to change memory_limit and upload_max_filesize). As far as I can tell, I'm editing the correct file. phpinfo() gives: Loaded Configuration File /etc/php.ini The file permission is 644. There are also some extra .ini files on /etc/php.d, but none include any of the keys I'm trying to change. No matter what I do, phpinfo reports the default values on both "Local" and "Master" columns. I also scanned my Apache config files, but found nothing related to PHP (besides loading the PHP module). The only way I was able to change those settings was by adding some php_value lines to my .htaccess. Is there something obvious I'm missing? This is a virtual server, and I can perform root commands with sudo. I'm running Apache 2.1.3 and PHP 5.3.3. System info (from uname -a) is: Linux sesctbapp01 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 EST 2012 x86_64

    Read the article

  • PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/apc.so'

    - by user3207586
    I have updated my php from 5.3.3 to 5.4.31. I have a Debian 6 Squeeze. PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/apc.so' - /usr/lib/php5/20100525/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0 During the installation, the system ask me if I want to keep the actual php.ini or put the new one. I said to keep the actual one. Now, I have this 2 errors when I restart Apache.. What should I do to solve them?

    Read the article

  • PHP-FPM for nginx on debian

    - by Jelko
    What is the preferred/recommended way of installing php-fpm on debian for use with nginx? I read about a "php5-fpm" package everywhere, but it's not available in the official debian repos any more. The PHP-FPM website (http://php-fpm.org/download/) says that fpm is now included with the php core. Is it enough to install "php5-common" then? Where are the config files, though? Other people recommend to install the current version of php and php-fpm from dotdeb.org. The versions provided there are generally more up to date. But is it secure? Is this a good repo to use in a production environment? I would appreciate any advice.

    Read the article

  • Make a socket as a user but make it readable and writable by another

    - by user1598585
    I have a software that is run under user A, this software creates a socket in /sockets and the socket should be readable and writable by user B. I have tried setting the directory to have ownership A:A or A:B but when user A creates the socket, it ends up with uid A and gid A. Using ACLs has not helped so far, the default mask is preventing the rights to be effective. rw permisions for B will always turn into jusr r. If what I make is not a socket it will work fine. How can I best accomplish this task? (It is for a web-server where the web-application makes the socket and the web-server software forwards requests to it)

    Read the article

  • Make a socket as an user but make it readable and writable by another

    - by user1598585
    I have a software that is run under user A, this software creates a socket in /sockets and the socket should be readable and writable by user B. I have tried setting the directory to have ownership A:A or A:B but when user A creates the socket, it ends up with uid A and gid A. Using ACLs has not helped so far, the default mask is preventing the rights to be effective. rw permisions for B will always turn into jusr r. If what I make is not a socket it will work fine. How can I best accomplish this task? (It is for a web-server where the web-application makes the socket and the web-server software forwards requests to it)

    Read the article

  • php open_socket

    - by sea_1987
    Hello, I am trying to open a socket to use with secure tradings xpay api, however when I check to see if the socket is open I get error returned, Can't assign requested address I need to open up 127.0.0.1:5000 is there something wring with my code that means I cannot do this? if (isset($xpay_port) and ($socket=socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) and (socket_connect($socket, $address, $port))) { $text="Connection successful on IP $address, port $port"; socket_close($socket); } else $text="Unable to connect<pre>".socket_strerror(socket_last_error())."</pre>"; echo "<html><head></head><body>". $text. "</body></html>";

    Read the article

  • Create shortcut for PHP

    - by Daniel
    I have XAMPP installed and my PHP is: /opt/lampp/bin/php-5.3.8 Every time I need to execute a PHP file I need to do this: /opt/lampp/bin/php-5.3.8 testando.php Is there another way to execute it besides using symbolic link? I did this on /etc/init.d/: sudo ln -s /opt/lampp/bin/php-5.3.8 php Why when I need to run PHP I have to do this ./php instead of just php? And is there a way to do this without the ./? Like it was installed via apt-get?

    Read the article

  • Apache VirtualHosts define php.ini but extend main php.ini

    - by Hosh Sadiq
    I have a main php.ini file and am wondering if it is possible to specify a custom php.ini for a virtualhost, but this php.ini would extend the main php.ini file, so that only the specified settings are overridden and everything else is taken the main php.ini. For example: I have my main php.ini file in /etc/php5/php.ini, containing all the defaults. Let's say this has everything as default so e.g. allow_url_fopen = On allow_url_include = Off Then I have my virtualhost located at /home/user/php.ini and this contains the following: allow_url_fopen = Off This php would run with first the php.ini in /etc/php5/php.ini then the settings that are in /home/user/php.ini resulting in a configuration where both allow_url_fopen and allow_url_include are set to Off. Edit: Also, if /home/user/php.ini does not exist, it would default back to /etc/php5/php.ini

    Read the article

  • Centos 6.5 -- backported upgrades/php.ini directives included in php 5.3.3

    - by Decave
    PHP 5.3.3 is the latest version of PHP available with the official CentOS 6.5 repos. As most of you know, calling it version '5.3.3' is slightly deceptive because critical bug fixes are actually back ported into version 5.3.3, so in effect 'version 5.3.3' does get upgraded now and then. My question is: aside from manually toggling directives in php.ini, how can you tell which new directives, that were implemented in, and officially supported by, later versions of PHP, are also available in CentOS 6.5's backported PHP 5.3.3? For example, max_input_vars (http://php.net/manual/en/info.configuration.php#ini.max-input-vars) has been available since PHP 5.3.9. IS there an easy way to tell whether CentOS included this in a backported upgrade to 5.3.3? Thanks!

    Read the article

  • PHP enable sqlite phpinfo states --without-sqlite

    - by Jahmic
    I've seen similar questions but none that address my situation adequately. I'm running Apache and PHP 5.3.6 on a amazon cloud server. phpinfo keeps stating that sqlite is disabled. At least that what it seems from the configure line: './configure' ... '--without-sqlite' In other parts of phpinfo() output: PDO PDO drivers mysql, sqlite PDO Driver for SQLite 3.x enabled SQLite Library 3.6.20 sqlite3 SQLite3 support enabled SQLite3 module version 0.7-dev SQLite Library 3.6.20 Directive Local Value Master Value sqlite3.extension_dir no value no value and at least one the following PHP commands fail: if (!extension_loaded('SQLite') OR !function_exists('sqlite_open')) Yum install states that both sqlite and pdo-lite are already installed. I've tried to enable sqlite by editing my local php.ini by adding: ; Enable sqlite3 extension module extension=sqlite3.so I've checked the main php.ini (/etc/php.ini) and there is nothing specific about disabling it. In fact, there is a sub-conig file loaded in php.d that also specifies this extension as well as another for the pdo-sqlite I'm running of things to look for or try. Any suggestions. How do I find where the PHP configure is stated? Thanks

    Read the article

  • FastCGI Error when installing PHP on IIS7.5

    - by ytoledano
    I'm trying to install MediaWiki on a Win2008r2 server, but can't manage to install PHP. Here's what I did: Grabbed a Zip archive of PHP and unzipped it into C:\PHP. Created two subdirs: c:\PHP\sessiondata and c:\PHP\uploadtemp. Granted modify rights to the IUSR account for the subdirs. Copied php.ini-production as php.ini Edited php.ini and made the following changes: fastcgi.impersonate = 1 cgi.fix_pathinfo = 1 cgi.force_redirect = 0 open_basedir = "c:\inetpub\wwwroot;c:\PHP\uploadtemp;C:\PHP\sessiondata" extension = php_mysql.dll extension_dir = "./ext" upload_tmp_dir = C:\PHP\uploadtemp session.save_path = C:\php\sessiondata Install Web server role, selected CGI and HTTP Redirection options. In the Handler Mappings: Added Module Mapping. Entered the following values: Path = *.php, Module = FastCgiModule, Executable = c:\php\php-cgi.exe, Name = PHP via FastCGI. Created a test page into wwwroot directory: phpinfo.php and set the contents like this: < ?php phpinfo(); ? Browsed to http://localhost/phpinfo.php But then I get: HTTP Error 500.0 - Internal Server Error An unknown FastCGI error occured Detailed Error Information Module: FastCgiModule Notification: ExecuteRequestHandler Handler: PHP via FastCGI Error Code: 0x800736b1 Requested URL: http://localhost:80/phpinfo.php Physical Path: C:\inetpub\wwwroot\phpinfo.php Logon Method: Anonymous Logon User: Anonymous Does anyone know what I'm doing wrong here? Thanks.

    Read the article

  • nginx: php-fastcgi running but php files not executing

    - by Daniel
    I have recently set up a nginx server with PHP running as FastCGI process. The server is running with HTML files however PHP files are downloading instead of displaying and PHP code is not processed. This is what I have in nginx.conf: server { listen 80; server_name pubserver; location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } } The command netstat -tulpn | grep :9000 displays the following which indicates php-fastcgi is running and listening on port 9000: tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 2663/php-cgi If it's if any importance my server is running on CentOS 6 and I installed nginx and PHP using the repositories from The Fedora Project.

    Read the article

  • Apache 2.2/PHP is not loading the correct php.ini

    - by Jesper
    I have been struggling with this for days. I have a windows server 2008 where I have installed Apache 2.2, PHP and MySql. I kept getting the error that mysql_connect was an unknown function, so I followed all guides I could find but with no result. I have now noticed that phpinfo says that php.ini dir is C:\Windows. This is strange since I've written this in httpd.conf: PHPIniDir 'c:\PHP\' LoadModule php5_module "c:/PHP/php5apache2_2.dll" AddHandler application/x-httpd-php .php How do I get apache and php to read my php.ini and thereby include mysql?

    Read the article

  • PHP-FPM conf location option when compiling php

    - by Danack
    I'm compiling PHP from source. I would like to set the location that PHP-FPM looks for it's config file. Apparently this option should be set via the configure option: --with-fpm-conf=/etc/php/php-fpm.conf According to http://php-fpm.org/wiki/Configuration_File However using this option on PHP5.5.0 gives the error configure: WARNING: unrecognized options: --with-fpm-conf How do I set where PHP-FPM should look for it's conf file when compiling from source?

    Read the article

  • nginx + php fpm -> 404 php pages - file not found

    - by Mahesh
    *2037 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream server { listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 server_name .site.com; root /var/www/site; error_page 404 /404.php; access_log /var/log/nginx/site.access.log; index index.html index.php; if ($http_host != "www.site.com") { rewrite ^ http://www.site.com$request_uri permanent; } location ~* \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_read_timeout 240; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ /(libraries|setup/frames|setup/libs) { deny all; return 404; } location ~ ^/uploads/(\d+)/(\d+)/(\d+)/(\d+)/(.*)$ { alias /var/www/site/images/missing.gif; #i need to modify this to show only missing files. right now it is showing missing for all the files. } location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { access_log off; expires 20d; } location /user_uploads/ { location ~ .*\.(php)?$ { deny all; } } location ~ /\.ht { deny all; } } php-fpm config is default and is not touched. The problem is little strange for me. Error pages are showing File not found only if they are .php files. Other error files are clearly calling the 404.php file site.com/test = calls 404.php site.com/test.php = File not found. I am searching and making changes. but it hasn't solved the problem.

    Read the article

  • php extension COM_DOTNET.dll

    - by aXul
    I'm trying to add a PHP extension (PHP_COM_DOTNET)to my server, by writing the following in my php.ini [COM_DOT_NET] extension=php_com_dotnet.dll I downloaded the dll file and put it in my ext folder, but when restarting the server, I got the following errors cant find entry point zend_new_interned_string in php5ts.dll php startup: unable to load dynamic library php_com_dotnet.dll couldn't find especified process I'm using php 5.3.18 on a xampp-like package (vertrigoserv)

    Read the article

  • Update to recent stable php in Ubuntu 12.04

    - by Jurian Sluiman
    We run an Ubuntu 12.04 server where php 5.3.10 is installed by default. I thought Ubuntu did only apply bugfixes in their updates, so micros like 5.3.x should pass through. Apparently, our version isn't updated, but we are stuck with a critical bug in php which is solved in 5.3.15. Should I wait longer for this release to bubble up? Or are there safe repositories to use for Ubuntu to continuously update php and php related packages?

    Read the article

  • TcpListener Socket still active after program exits.

    - by lnical
    I'm trying to stop a TCP Listener as my program is exiting. I do not care about any data that is currently active on the socket or any of the active client sockets. The socket clean up code is essentially: try { myServer.Server.Shutdown(SocketShutdown.Both) } catch (Exception ex) { LogException(ex) } myServer.Server.Close(0) myServer.Stop() myServer is a TCPListener On some occasions, Shutdown will thrown an exception System.Net.Sockets.SocketException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied at System.Net.Sockets.Socket.Shutdown(SocketShutdown how) When this happens, the socket is never released. Even after the application exits netstat shows the socket is still in the listening state. I have not been able to create definitive reproduction scenerio, it happens at seemingly random times. Client Sockets are cleaned up independently. Do you have any suggestions to help me make this socket die?

    Read the article

  • how to bind/connect multiple UDP socket

    - by nicboul
    My initial UDP socket is binded to 127.0.0.1:9898. The first time that I get notified of incoming data by epoll/kqueue, I do recvfrom() and I fill a struct sockaddr called peer_name that contain the peer informations (ip:port). Then I create a new UPD socket using socket(), then I bind() this newly created socket to the same ip:port (127.0.0.1:9898) than my original socket. then I connect my newly created socket using connect() to the peer who just sent me something. I have the information in the struct sockaddr called peer_name. I then add my newly created socket in my epoll/kqueue vector and wait for notification. I would expect to ONLY receive UDP frame from the peer i'm ""connected to"". 1/ does netstat -a -p udp is suppose to show me the IP:PORT of the peer my newly created socket is ""connected to"" ? 2/ I'm probably doing something wrong since after creating my new socket, this socket receive all incoming UDP packets destinated to the IP:PORT I'm binded to, regardless of the source peer IP:PORT. I would like to see a working example of what I'm trying to do :) or any hint on what I'm doing wrong. thanks!

    Read the article

  • Socket send recv functions

    - by viswanathan
    I have created a socket using the following lines of code. Now i change the value of the socket i get like this m_Socket++; Even now the send recv socket functions succeeds without throwing SOCKET_ERROR. I expect that it must throw error. Am i doing something wrong. struct sockaddr_in ServerSock; // Socket address structure to bind the Port Number to listen to char *localIP ; SOCKET SocServer; //To Set up the sockaddr structure ServerSock.sin_family = AF_INET; ServerSock.sin_addr.s_addr = INADDR_ANY; ServerSock.sin_port = htons(pLantronics->m_wRIPortNo); // To Create a socket for listening on wPortNumber if(( SocServer = socket( AF_INET, SOCK_STREAM, 0 )) == INVALID_SOCKET ) { return FALSE; } //To bind the socket with wPortNumber if(bind(SocServer,(sockaddr*)&ServerSock,sizeof(ServerSock))!=0) { return FALSE; } // To Listen for the connection on wPortNumber if(listen(SocServer,SOMAXCONN)!=0) { return FALSE; } // Structure to get the IP Address of the connecting Entity sockaddr_in insock; int insocklen=sizeof(insock); //To accept the Incoming connection on the wPortNumber pLantronics->m_Socket=accept(SocServer,(struct sockaddr*)&insock,&insocklen); if(pLantronics->m_Socket == INVALID_SOCKET) { shutdown(SocServer, 2 ); closesocket(SocServer ); return FALSE; } // To make socket non-blocking DWORD dwNonBlocking = 1; if(ioctlsocket( pLantronics->m_Socket, FIONBIO, &dwNonBlocking )) { shutdown(pLantronics->m_Socket, 2); closesocket(pLantronics->m_Socket); return FALSE; } pLantronics->m_sModemName = inet_ntoa(insock.sin_addr); Now i do m_Socket++;//change to some other number ideally expecting send recv to fail. Even now the send recv socket functions succeeds without throwing SOCKET_ERROR. I expect that it must throw error. Am i doing something wrong.

    Read the article

  • PHP throwing XDebug errors ONLY in command line mode...

    - by Wilhelm Murdoch
    Hey, all! I've been having a few problems running PHP-based utilities within the command line ever since I enabled the XDebug. It runs just fine when executing script through a browser, but once I try an execute a script on the command line, it throws the following errors: h:\www\test>@php test.php PHP Warning: PHP Startup: Unable to load dynamic library 'E:\development\xampplite\php\ext\php_curl.dll' - The specified module could not be found in Unknown on line 0 PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0 h:\www\test> The script runs just fine after this, but it's something I can't seem to wrap my head around. Could it be a path issue within my php.ini config? I'm not sure if that's the case considering it throws the same error no matter where I access the @php environmental variable. Also, all paths within my php.ini are absolute. Not really sure what's going on here. Any ideas? Thanks!

    Read the article

  • place to host a simple php socket server

    - by bonusbox
    i am running a small project that occasionally requires me to run a php socket script through ssh. it uses a few bytes of bandwidth (just some text) which activates my art installation project. i tried a simple web hosting plan but that didn't support sockets, so know i am using a 32$ vps plan on namecheap.com just to run a simple php script. i don't really need to host anything else on it. i find it kind of excessive for such a simple thing. is there a place i can run my script for a lower cost? any servers that support php sockets and ssh?

    Read the article

  • PHP stop working after a server reboot

    - by Ido Bukin
    I reboot my server and suddenly the PHP-FastCGI stop working . I try to do - /etc/init.d/php-fastcgi restart Also i try to restart my Nginx : /etc/init.d/php-fastcgi restart How can i turn on my PHP again ?? My server run - Ubuntu 11.10 Nginx 1.2.3 MySQL PHP-FastCGI Also i want to ask it is possible that i have 2 Nginx installs on my server and they run in the same time ? when i check the Nginx version in the console its says that the version is 1.2.3 And when i go to my site i see - 502 Bad Gateway nginx/1.0.5 How can i fix this ?

    Read the article

  • PHP short_open_tag Won't Enable (CentOS 6)

    - by brack
    I'm setting up an Apache2, PHP 5.3.3 server running on CentOS 6. My web application uses the short tags <? and <?=. I can't seem to get the short tags enabled. When I run phpinfo() I see short_open_tag = off, however in /etc/php.ini I have this: short_open_tag = on (and yes I've restarted the server). I've also tried using <?php ini_set('short_open_tag','1'); ?> at the start of a page and it still doesn't parse code in short tags. The only thing I can think of is there's another php.ini file somewhere that is being used instead of, or overriding the one at /etc/php.ini. Any advice?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >