PHP Sockets Not Working - sockets

I switched from Lighttpd server to WAMP and then found sockets in php are not working. But php is configured and working. (phpinfo() works) I removed the comment for the php_sockets.dll in php.ini # C:\wamp\bin\php\php5.2.5.but still gives the error "Fatal error: Call to undefined function socket_create()". Any more configurations to do to enable sockets in php in WAMP? (php_sockets.dll is there as well, I've checked)
Thank You!

Apparently there are two php.ini files - and the command line uses a different one to the Apache server.
find the line ;extension=php_sockets.dll and remove the semi-colon from both files.
The Apache php.ini file is located at:
X:\WAMP INSTALL DIR\bin\apache\Apache2\bin\php.ini
The command prompt php.ini file is located at:
X:\WAMP INSTALL DIR\bin\php\php.ini
Worked straight away for me...

Title is misleading - in your case PHP soockets are merely not available.
I removed the comment for the php_sockets.dll in php.ini # C:\wamp\bin\php\php5.2.5
Did you check that is the .ini file which PHP is using at runtime?
Did you restart the webserver?
Have you got all logging enabled?
Do you get startup errors?
C.

Left click wamp->PHP->PHP Extensions->php_sockets

Related

NetBeans 12.2 not connecting to Xdebug version 3

Got a problem I need to get working. I'm having difficulty getting NetBeans 12.2 to connect to Xdebug. When I try to debug I get the dreaded "Waiting For Connection (netbeans-xdebug)" which never connects. I'm running the following:
PHP version 8.0.2
Apache 2.4.46
Xdebug 3.0.3
I've read some of the other threads e.g.
netbeans shows "Waiting For Connection (netbeans-xdebug)"
Netbeans waiting for connection to XDEBUG
but they are for older versions of Xdebug and the solutions don't seem to work/commands are not the same. Having read the documentation and reading a solution in another threat my php.ini file has this at the end:
[xdebug]
zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-8.0-vs16-x86_64.dll
xdebug.client_port = 9003
xdebug.remote_handler = "dbgp"
xdebug.client_host = "localhost"
xdebug.mode=debug
xdebug.start_with_request=yes
When I click debug and run netstat I can see port 9003 is listening, but for some reason this just won't connect. I need this for work so I'm hoping someone can help a noob out? Best regards.
I had the same problem, and these are the steps how i solved it:
I reinstalled XAMPP, because I ruined my php.ini file due to configurate it too many times.
Then I followed the steps from the Xdebug homepage. You can overread it fast if you don't focus.
2.1 Download the .dll File and place it in your "Xampp/php extension directory" (C:\xampp\php\ext)
2.2 Name it to: "php_xdebug.dll"
2.3 Open the php.ini File (C:\xampp\php\php.ini)
2.4 Implement following line: "zend_extension = xdebug"
Note: I don't know if the order is important but for just in case put this Line under the following line: ";extension=shmop"
2.5 Activate the step debugger with implementing following lines:
"xdebug.mode=debug" (tells that
"xdebug.start_with_request=default"
Note: Here the same, put these lines under the following line: "extension=php_ftp.dll" (You can search for it, with the right editor)
Now you are finished with the php.ini file and can start with the Netbeans configuration.
The debug configuration in Netbeans (Tools > Options > PHP > Debugging):
Netbeans configuration
The project properties in Netbeans (right-click on project > properties):
Sources
For Source and Project Folder I entered the same directory, in this case my Project.
(right-click on project > properties > Run Configuration):
Run Configuration
Links:
https://xdebug.org/docs/step_debug
https://xdebug.org/wizard
My PHP xdebug config:
myphpinfo() - xdebug_config
Note: Step Debugger has to be enabled
PS: I tested this config. with PHP-8 and xdebug-3 and as "localhost" on Windows 10. It doesn't work for older versions!
I hope it solves your problem, i would be happy about a feedback!
There can be many reasons:
1.Missing php ini config
xdebug.idekey=netbeans-xdebug (or the value from netbeans settings - Session Id)
~ I think that form a specific version of netbeans 12.* this has been removed, but still you can give it a try
try to configure the path mapping
Map the xamp simulated server path to the real path on your computer
To see your server path you could try to do a var_dump($_SERVER['DOCUMENT_ROOT').
It must be written as in linux format using '/' sepparator.
3.Optional If you are debugging with chrome check if the netbeans connector addon is enabled. Try to debug also with other browsers like firefox or edge to see if there is a difference.

httpd.exe - Entry Point Not Found XAMPP

I am working on some stuff for mongodb and when I try to launch Apache using XAMPP an error occurs: "The procedure entry point compiler_globals_offset could not be located in the dynamic link library D:\XAMPP\php\ext\php_mongodb.dll" I do have a comment in php.ini (D:\XAMPP\PHP) that targets it: extension=php_mongodb.dll. The launch does work if I comment the extension=php_mongodb.dll
Thanks for your help.
I run into the same issue. But than I saw, that I had chosen the DLL for a wrong php version.
Just check for your self if you download the dll for the right php version

I am unable to connect to the extension marketplace of Visual Studio Code

I found one solution, download latest version from VSCode website. I tried same but still facing this issue.
i want to add React Native extension.
I am unable to access this URL because of the Proxy.
How to resolve this issue?
I'm using VSCodium On Archlinux and had the same problem. I installed vscodium-bin-marketplace to make it work. There's also a package named code-marketplace for Code OSS.
I found a solution that works for me.
Stop VSCode.
Open ~/.vscode/argv.json if you're using VSCode
Open ~/.vscode-oss/argv.json if you're using VSCodium
Then add
// Browser Code Loading.
"enable-browser-code-loading": false
Don't forget to add a comma to the previous entry, since this is a JSON file (but you knew that already, right?).
This just worked for me:
Add the proxy server to VS Code settings.json (open it in VSCode command line)
Add keys "http.proxy" and "https.proxy" with values of your Proxy Server URL, for example:
settings.json:
{
...
"http.proxy": "http://my-http-proxy-server.com:123",
"https.proxy": "https://my-https-proxy-server.com:124"
}
Bypass the url from proxy.
Open proxy settings (run command - inetcpl.cpl)
Go to connection tab, now in your proxy add that url
If it works then ok . Else you have to contact network team or need to do some firewall settings
Unistall vscode from unins000.exe C:\Users\{username-PC}\AppData\Local\Programs\Microsoft VS Code
Delete C:\Users\{username-PC}\AppData\Roaming\Code
Delete C:\Users\{username-PC}\.vscode
Restart
I went to Toggle Developer Tools. As described in here. Saw that ERR_TUNNEL_CONNECTION_FAILED error is there.
I had a proxy server added to the network settings. (Which was working fine for other purposes) I had to remove the proxy server in order to get this working.
Deleting my .vscode (hidden folder) worked for me.
C:\Users\USERNAME.vscode
Other alternative could be uninstalling vscode and deleting the whole folder at
C:\Users\USERNAME\AppData\Local\Programs\Microsoft VS Code
1.Unistall vscode from unins000.exe C:\Users\{username-PC}\AppData\Local\Programs\Microsoft VS Code
2.Delete C:\Users\{username-PC}\AppData\Roaming\Code
3.Delete C:\Users\{username-PC}\.vscode
4.Restart
5.Reset your windows firewall
6.Restart and install Vscode
This worked for me: in extensions search box, wrote #color (I'm guessing searching for anything will do) and extensions tab populated with results. Never saw the error again.
I recommend this solution for linux operating systems:
in file ~/.vscode-oss/argv.json
add this line: "enable-browser-code-loading": false
I am using kaspersky antivirus, disable it for a while, and my problem solved.
If no option works above. You can install the extension through the Vsix file.You can download it from this site.
Vsix File Free Download
If you are using linux you can install code-marketplace using your package manager which in my case it's pamac.
Just like this:
pamac build code-marketplace
This fixed my problem loading extensions in vscode.
goto your pc settings and look for proxy
turn it all off
that worked for me
I just uninstalled vscode downloaded it again and it works fine now for me you can try out this once
When you look at the ip-traffic what it tries to do, it starts with DNS-query with A-record (good) and also with AAAA-record (not so good if you don't have proper v6 routing in place).
Application should have built-in code to try AAAA-record connections and if they fail, it should automatically fall back to v4-connections and routing. Now it fails to do so and just gives an error that it failed to connect marketplace. Well, you just didn't try hard enough, did you?
For Linux systems, you disable your host's v6 protocol with:
# sysctl -w net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6 = 1
# sysctl -w net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6 = 1
and you might want to write them into /etc/sysctl.conf file as well.
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
I did it using the world's best editor Vim! :)
You need to restart the application before marketplace starts working.

How to fix 'Internal Server Error' for Zend Server?

I just downloaded ZendServer 6.2.0 and installed it to my computer. My OS is Windows 7. When I tried to launch the desktop icon, the browser said 'Internal Server Error'. How should I go about checking the root cause and fix it? How can I start using the server?
I finally got it working. I am posting the solution here in the hope that it will help others.
I checked "Zend Server/Apache2/logs/error.log" and found that a line says: "Zend Enabler cannot load because of a problem in its configuration file: XML parse error on line 1 column 1 - invalid byte '?' at position 3 of a 3-byte sequence"
Here is the solution:
Open "Zend Server/Zend Server/etc/ZendEnablerConf.xml". You will see some messed up characters in the first line. Delete them. Make sure the first line is properly tagged. Restart the Apache2.2 Zend Server at your system tray.
Now you can launch the icon.

Zend Framework 2 magic quotes gpc

I'm trying to install the Zend skeleton application and when I run the command "php composer.phar create-project --repository-url="http://packages.zendframework.com" zendframework/skeleton-application path/to/install" I get an error about magic_quotes being deprecated. I'm using GoDaddy servers and I turned magic_quotes off in my php.ini file. Any ideas what could be causing the problem?
Based on the error it looks like my the file in /web/conf/php5.ini has magic_quotes On for some reason. It's a read only file that I can't change. Shouldn't the file in the root of my server be changing the setting in it?
When I run phpinfo it shows magic_quotes_gpc and the other magic_quotes all as Off. What could be causing this error message in ssh?
Could it be because my GoDaddy hosting account is running PHP 5.3.24? The minimum on the Zend site says 5.3.3