joesaddigh
Members-
Posts
93 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
joesaddigh's Achievements
Member (2/5)
0
Reputation
-
Hi, I am currently running PHP 5.4.12 and cannot find a compatible php_win32service.dll to download. All the ones that I have seen seem to be for PHP 5.2/5.3? When trying to use the dll made for these versions, I get the following error message: PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_win32service.dll' - The specified module could not be found. It is worth pointing out that I have put the dll in the correct place along with the other extensions! Please can somebody give me any advice on where to go from here? Thanks in advance. Joe
-
Hi, This is probably a really basic question but I really can't find the answer. Once I have configured and downloaded Nginx and PHP how do I actually run a PHP script, i.e. I create a simple index.php page and I want to open it in a browser and ensure the PHP code is run. My dir structure is as follows: C:\nginx C:\nginx\php My nginx.conf file is: #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} location ~ .php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME c:/nginx/html/$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} } I have created a batch file for starting and stopping the php service and this seems to work (I run tasklist /svc) and I see the php-cgi.exe service appear and disappear. Although when I run the start service: @ECHO OFF c:\nginx\nginx.exe c:\nginx\php\php-cgi.exe -b 127.0.0.1:9000 -c c:\nginx\php\php.ini ping 127.0.0.1 -n 1>NUL echo Starting nginx echo . echo . echo . ping 127.0.0.1 >NUL EXIT It gives me an error "nginx: [alert] could not open error log file: CreateFile() "logs.error.log" failed (3: The system cannot find the path specified) even though I have added a file at this level: C:\nginx\logs\error.log Please any suggestions would be very much appreciated! Joe
-
Hi, I have managed to debug my PHP application using XDebug and Eclipse - This is like a dream as I am used to the luxury of a debugger :-) However I have a few problems... 1) It will only stop at any of my breakpoints if I start the debug session from index.php - Used to work on other pages too but since I tried to uncheck the Break at first line this problem arose? I only want it to stop at my breakpoints which is why i fiddled with these settings in the first place.. 2) In the PHP debugger section it seems to think I am using the Zend Debugger - I don't even have this installed (why does it work?) I originally set it up with the Xdebug as this choice? 3) How do you simply import an existing php file into your project? I did it by using windows explorer view and dragging the files I wanted to use in to eclipse which seemed to add them to the library. However when I later did a create new file selection and then debugged it didn't find the file. I then created the new file manually and drag and dropped it in and it worked fine? my php.ini settings are as follows: [XDebug] zend_extension = "C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=1 xdebug.remote_host=localhost xdebug.remote_port=9001 xdebug.remote_handler=dbgp xdebug.profiler_enable=0 xdebug.remote_mode=req xdebug.remote_autostart=0 Image attached to show relevant settings in Eclipse: Please any advise would be greatly received. Thanks, Joe 17236_.doc 17237_.doc
-
Yeah that's how I have got along so far. Going to give setting up zend another go as it makes itso much quicker being able to debug. Thanks for your help.
-
That' excellent. Looking forward to creating some useful classes that I can re-use. One more thing if you don't mind. What do you use to debug PHP and is this easy to setup (know of any tutorials). I have tried setting up Zend studio before but not had a lot of luck so am using Dreamwever for now which means that I simply echo variable contents as and when I need to debug. Sorry that this is unrelated but would appreciate any help on this. Thanks again!
-
Ah yess.. What an idiot I am. I want to try and put some of the common tasks that I perform regarding DB functions into a class which I can just create and use all over the place. The thing I am finding difficult to get used to is not having to specify data types and knowing what a function like: mysql_query mysql_fetch_array returns? Also when you declare a function within a class you dont say perhaps: ReturnType function NameOfFunction( param1, 2, 3 ) { return something; } You can simply do this: function NameOfFunction( param1, 2, 3 ) { return something; } So if I wanted to return the result of a mysql_fetch_array from a function that takes sql as a param and then use this in the caller of the func how woud I loop through the result that I would expect to be returned? Thanks for your help.
-
Hi, I have decided to try and write some OO php. I have a simple class with one function. I am trying to instantiate an object of that class using the new operator but get an error. Parse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\wamp\www\School\addcourse.php on line 38 <?php $CDBController = new CMasterDataController; //THIS IS LINE 38 CMasterDataController->PerformQuery("SOME SQL HERE"); ?> I am including the file that contains this class (CMasterDataController) in this file (addcourse.php). The version of PHP i am using is 5.3.8. Does anybody know what I am missing? Thanks, Joe
-
Perfect thanks for your help. It was the DB that was messing it all up for me. The code posted now works perfectly.
-
hi, It was the DB field being stored as a Date. Changed to a string so will have a play now. Getting better results. Thanks for your help
-
I had the code like that at some point. the output of that was this: 2020-10-11 00:00:00?? What am I doing wrong? Thanks,
-
Nothing its declared and assigned in the same statement $DateAndTime = date('d-m-y', strtotime($DateAndTime)); All I want is the current date in the format DD-MM-YYYY followed by the time. This must be a simple task?
-
Hi, When I do this the result is a date of zeros? $DateAndTime = date('d-m-y', strtotime($DateAndTime)); All I want is a date in format of DD0MM-YYY and the Time in HH:MM::SS Any help would be great! I know it is basic, Thanks in advance
-
That makes sense I can see the good reason for this. Cheers
-
Excellent Thanks! I thought that the $conn would still be in scope? Joe
-
Hi, I have some code which works but when I created a function and call this same code it doesn't. The error I get is as follows: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/fhlinux010/l/languageschoolsuk.com/user/htdocs/admin/email.php on line 42 Error retrieving schools The code function CreateSchoolCheckboxes() { echo '<div style="height:400px;width:400px;font:16px/26px Georgia, Garamond, Serif;overflow:scroll;">'; $querySchools = "SELECT * FROM school"; $result = mysql_query($querySchools, $conn) or die ("Error retrieving schools ".mysql_error()); while($row = mysql_fetch_array($result)) { $schoolname = $row['name']; echo '<input type="checkbox" name="school" value="'.$schoolname.'">'; echo $schoolname . '<br>'; } echo '</div>'; } Im sure that this is probably something simple but any suggestions would be much appreciated. Thanks, Joe